catch os.Interrupt (ctrl-C) so that the tty state can be restored before terminating