Fix GL_INVALID_OPERATION and other GL errors when GL functions are called with OpenGL context already removed

Objects shall be destroyed in inverse order.