Fix destruction order of GLContextManager and dependent objects.