Ensure glfwInit is only called once and glfwTerminate is called even after task failure.

This also removes the need for the `glfw::terminate` function

Edit: Note that `ffi::glfwTerminate` is *guaranteed* to run once at the end of shut down because it is queued using `std::rt::at_exit`.