Terminate cleanly on SIGINT or SIGHUP