Fixed test that failed when the mirrow window wasn't used
Protect OpenGL contexts against concurrent usage by multiple threads