Reinstate signal handlers that got lost in the gtk3 transition

Also, fix a segfault when handling SIGINT.