Move OSD rendering after the GLX context setting

Hopefully this will now be able to render OSD texture.