[misc] properly handle SIGTERM
Merge pull request #11 from DarkKnightCZ/misc

[misc] properly handle SIGTERM