Using escape to quit settings or slider

It also checks if we're still running after
handling events in case one of them had terminated the program.