correctly handle SIGINT, SIGTERM and SIGTTOU
Merge pull request #10 from sstur/signals

correctly handle SIGINT, SIGTERM and SIGTTOU