Refactor XCBPollForEvent with a shorter critical section.
Refactor XCBPollForEvent with a shorter critical section.

This simplifies the patch for bug #8208 later.

topcat/xcb-win32,OpenInkpot-archive/iplinux-libxcb,OpenInkpot-archive/iplinux-libxcb,topcat/xcb-win32,stapelberg/libxcb,topcat/xcb-win32,OpenInkpot-archive/iplinux-libxcb,stapelberg/libxcb,stapelberg/libxcb,topcat/xcb-win32,topcat/xcb-win32