Proper treatment of Ctrl-C interruption