Handle KeyboardInterrupt.