Catch KeyboardInterrupt and exit nicely