Implemented signal handlers for SIGHUP, SIGINT, SIGTERM and SIGKILL that makes the Qt event loop exit.