Fix SIGHUP endless loop.
Some fixes for OpenBSD.