[X11] Fix hang when exiting XI2 input thread

Fixes https://github.com/mono/MonoGame/issues/2711