Lakka and GLUI fixes for threaded video

This sort of fixes #835, but instead of a crash the user will get a black screen. I suspect this happens because the gl driver is running in a separate thread, thus the gl*() calls have no effect on the framebuffer.