Switch back to GL_TEXTURE_2D to enable i965 fast upload
Use GL_UNSIGNED_BYTE instead of GL_UNSIGNED_INT_8_8_8_8_REV

Together with the previous commit, this allows glTexSubImage to hit fast
texture upload path in i965 driver in Mesa 10.0 and 9.1 (not 9.2, which
switched to Y-tiled textures, but fast upload was not ready for that).
Correct condition for restarting workers on context change
Warn if drawable is not current to glXSwapBuffers thread
Implement PBO glDrawPixels upload/display path

Should be more efficient on i965 with Mesa-10.1+
Try to save power by sleeping before glMapBuffer

The expectation here is that glMapBuffer spends most of the time busy waiting
for pixel data arrival, so try to sleep for most of the waiting time instead.
Since we can't know how much time glMapBuffer time is going to take, use the
time from the previous frame and sleep for a fixed fraction of that (90% by
default).
Perform readback from the front buffer (GH-92, GH-110)

Looks like glXSwapBuffers for multisampled pbuffers is not a swap, but rather
a back-to-front copy.  Lack of a GPU fence following glReadPixels causes the
readback and the application race, manifesting as flickering.

Reading from the front buffer does not appear to have negative effect with
nVidia drivers.