OpenGLContext: Add locking/sync around X errors

In order to manipulate the (global) X error handler without races, we
need to lock the X11 display, and also push an XSync through between
locking and changing the error handler, so we don't catch unrelated
errors.

Change-Id: Ic970224c98c05c6e13aadd781f8275cde5f37dd0
OpenGLContext: Consistently select the window's visual

When using an FBConfig, make sure we use a config compatible with the
visual we've already created our child window for.

Also remove FBConfigs from the non-debug path, as these are only used
when creating a 3.2 context.

Change-Id: I7350f961781bdfcd2e5ca740a38f6d1b0b5474aa