From what I can see, the culprit would be this :
trace:opengl:X11DRV_SwapBuffers (0x403d55e0) trace:opengl:wglMakeCurrent ((nil),(nil)) X Error of failed request: GLXBadDrawable
As the glXSwapBuffers call may return before the buffer swap is actually done in hardware, it may happen that the driver does not handle properly an application which unsets the current context before the actual swap is done in the background.
Could you try to see if the attached 'hack' fixes the issue ? If yes, this may be a bug in NVIDIA's GL drivers, if not, we will need to investigate a bit more :-)
Thanks for that Lionel - unfortunately it's still doing the same thing even with your patch. I'm not sure what to try next...
Cheers, James