SDL: Fixed "stale global reference" causes
These changes were cherry-picked from SDL 2.  I'll be fully upgrading to SDL 2, so this is just a temporary fix in the mean time.