x11: Update x11 focus before updating MetaDisplay focus
In a similar vein to commit 8fd55fef. This notably failed with the when setting the focus on the stage (eg. to redirect key events to Clutter actors). Deeper in MetaDisplay focus updating machinery, it would check meta_stage_is_focused() which would still return FALSE at the time it's called.
This would not typically have side effects, but our "App does not respond" dialogs see the focus change under their feet, so they try to bring themselves to focus again. This results in a feedback loop.
Changing the order results in later checks on the X11 POV of the focus being correct, so focus is not mistakenly stolen from the close dialog, and it actually succeeds in keeping the key focus.
Fixes: gnome-shell#1607 (closed)