user32/tests: Flush events before changing foreground. No need to flush it after as activating the desktop window doesn't do anything on the X server side.
user32/tests: Make test_foregroundwindow test more reliable.