If the underlying X11 window gets destroyed, the event we're waiting for may never be delivered, in which case xcb_wait_for_special_event would hang indefinitely.
- Use xcb_poll_for_special_event to check if an event has arrived yet.
- If not, Wait up to ~1s for XCB's file descriptor to become readable; if it does, go back to step 1.
- If the file descriptor didn't become readable, make a round-trip to the X server to check that the window still exists. Go back to step 1 if it does, otherwise bail.
Also add an early bail-out when it's known that the window was destroyed.