Drain XRecord connection of any events after handling replies
Drain XRecord connection of any events after handling replies

If the X server sends an event to the XRecord connection the event
will never be handled. This will cause the event queue to fill up in
Xlib and lead to syndaemon running away at 100% cpu usage.

This change drains any events from the connection. It's not a fix for
the underlying bug in the server or Xlib, but it does paper over the
issue for now.

https://bugs.launchpad.net/bugs/754470
http://bugs.freedesktop.org/show_bug.cgi?id=31921

Signed-off-by: Chase Douglas <69e02ec421aa70a149511825d897f2549ceee9a2@canonical.com>
Signed-off-by: Peter Hutterer <b9c50af7afa7642f6f854434cda9ffe54ece8b85@who-t.net>
(cherry picked from commit bdc9c7cf9767bda77c690cb4211f6f6cb4567748)

philipn/xserver-xorg-input-synaptics,RsrchBoy/xserver-xorg-input-synaptics,philipn/xserver-xorg-input-synaptics,philipn/xserver-xorg-input-synaptics,RsrchBoy/xserver-xorg-input-synaptics