Handle the SDL quit event