Kill the listener thread if Ctrl-C is caught