x11: Catch Xlib errors with function wrappers

This patch defines a wrapper for each Xlib function called by the x11
directory.  Each wrapper catches any Xlib error emitted by the wrapped
function. The wrapper's signature matches the wrapped.

All Xlib errors generated by Waffle must be caught by Waffle. Otherwise,
the Xlib error handler installed by the user will catch the error and
may handle it in a way Waffle doesn't like. Or, even worse, the default
Xlib error handler will catch it, which exits the process.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
glx: Catch Xlib errors with function wrappers

This patch defines a wrapper for each GLX function called by the glx
directory.  Each wrapper catches any Xlib error emitted by the wrapped
function. The wrapper's signature matches the wrapped.

All Xlib errors generated by Waffle must be caught by Waffle. Otherwise,
the Xlib error handler installed by the user will catch the error and
may handle it in a way Waffle doesn't like. Or, even worse, the default
Xlib error handler will catch it, which exits the process.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>