Bugfix: protect the output queue from being written while another thread is flushing it.
Bugfix: protect the output queue from being written while another thread is flushing it.

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