X11: process events in order

Using (XCheckMaskEvent(...) || XCheckTypedEvent(..., ClientMessage, ...))
will process all other events before handling ClientMessages, possibly
processing the events in a different order than they arrived in.

Use XCheckIfEvent with an always-true predicate to remove events from
the event queue without blocking while holding the X11 global mutex.