Handle KeyboardInterrupt exception.