Dispatch pending then flush the connection to make sure we immediately
read () any new events from the compositor.

Currently PumpEvents polls the fd to see if there is any more data to be read
without blocking. If there is it calls _dispatch (), if not, it calls
_dispatch_pending ().

However, there is a possible condition where new events in the output buffer
might need to be sent to the compositor in order to get back the events that
we need to continue. In that case, we really need to dispatch pending events,
cause any new requests to be buffered up, flush the buffer and then poll, so
that we'll know if we need to read any more events in. Otherwise they might
come a little bit late.

Fixes Issue #2