Added manual select for X11 connection file decriptor

Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
Added internal global recursive mutex implementation

Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
Added locking in Xlib backend to Xlib access

Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
Added glFlush to Xlib backend for singlebuffered contexts

For singlebuffered contexts, glXSwapBuffers is a no-op and thus doesn't
do an implicit flush (on some implementations like Mesa or AMD).
When the context is never released and no flush happens, certain OpenGL
implementations freeze and go to 100% CPU.

Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
Added mutex implementation for WinDOS backend

TODO: No locking used in WinDOS backend yet.

Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
Added multithreaded/continuos OpenGL subview readraw to demo

Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>