correctly handle SIGINT, SIGTERM and SIGTTOU

This fixes an issue with running in background `serv &` which causes the process to hang. See: https://github.com/scothis/serv/issues/8