Better KeyboardInterrupt handling to avoid nodes reboot