X11: Fixed message boxes not responding to click on titlebar close button. The window needs to catch ClientMessage events for one specific window, but XNextEvent() catches everything, and XWindowEvent doesn't catch ClientMessage, so we need predicate procedure and XIfEvent() here. Fixes Bugzilla #2980.