X11: Fixed SDL_GetGlobalMouseState() to work better with multimonitor configs.

Fixes Bugzilla #2770.

Thanks to Epic Games for contributing this fix.

--HG--
extra : rebase_source : 99a461ce8585fe04bae8484f059a4b8e67bfbce6
extra : amend_source : e22ab83122073328d4f2a6c8f0349af134d5e9ee
Patched to compile on pre-C99 compilers.