support `destroy` callback

`destroy` should support a callback to allow safe shutdown in case of
SIGTERM or SIGINT
Merge pull request #19 from asapach/master

support `destroy` callback