make the global context current from the beginning
The globally shared OpenGLContext was not made current in the beginning. Therefore plugins which used OpenGL calls in the ininit function were using a different opengl context, which caused problems (e.g. when buffers were created)
The changes make the global context current in the beginning, instead of a temporary one.