Catch KeyboardInterrupt in the main entry point.