Catch SIGINT (ctrl-C/break) and try to close nodes prior to exit.