add cleaner exit code to GLFW apps

Before openframeworks would call std::exit in order to quit. The openGl context was not getting cleaned up properly and destructors were not being called .This commit fixes that issue. related to #2603 
This needs to be wrapped in preprocessor checks for all except Android and iOS