Improved GLFW context management