adds cleaner exit code to GLFW apps
Merge pull request #2894 from Ahbee/bugFix-GLFW-exit

add cleaner exit code to GLFW apps