wayland: Don't cancel a roundtrip when any event is received

Since wl_display_dispatch_queue() returns the number of processed events
or -1 on error, only cancel the roundtrip if an -1 is returned.

This also fixes a potential memory corruption bug happening when the
roundtrip does an early return and the callback later writes to the then
out of scope stack allocated `done' parameter.

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
radeon/r200: Fix tcl culling

Should fix:
https://bugs.freedesktop.org/show_bug.cgi?id=57842
automake: Convert Gallium target and winsys
gallium: Add common automake include file

v2: Matt Turner <mattst88@gmail.com>
    Remove ARCH_FLAGS/OPT_FLAGS

v3: Johannes Obermayr <johannesobermayr@gmx.de>
    Add -I$(top_srcdir)/include to GALLIUM_CFLAGS
r300g: Use gallium automake include file

[mattst88] v2: Remove ARCH_FLAGS/OPT_FLAGS
r300g: Build a libtool archive
r300g: Link ralloc.c and register_allocate.c into separate library
radeon/winsys: Convert to automake
trace: Convert to automake
libgallium: Convert to automake
r600g: Use gallium automake include file
i915g: Convert to automake
i915/winsys/drm: Convert to automake
i915/winsys/sw: Convert to automake
rbug: Convert to automake
llvmpipe: Convert to automake
softpipe: Convert to automake
svga: Convert to automake
nouveau: Convert to automake
nv30: Convert to automake