Add atexit handler to call SDL_Quit after successful SDL_Init. Code cleanup.