catch some additional quit events in loop (ESC and window X-button)