Saving and restoring cwd in GLFW backend.

Ready for review! Closes #659.