[3.38] screen-cast: Fix segfault when drawing cursor
Add a sanity check if the cursor is on screen and cursor texture data is available. This prevents a potential segfault when trying to access non-existing texture data.
Closes: #1446 (closed) Part-of: !1604 (merged)
(cherry picked from commit efb577ef)