Perform cleaner shutdown when killed by ctrl-C

Fix CLI messing up terminal input if exiting using ctrl-C.
Fix IRC client not sending disconnect.
Simply having a signal handler seems to cause class deconstructors to run as well.
Fix linkage warning in irc_main.cpp