Fixed serious deadlock in ogl_device.cpp