Process SIGINT and SIGTERM only in safe places
Merge pull request #199 from agpanarin/master

Process SIGINT and SIGTERM only in safe places