Added ability to wait for correct shutdown by waiting for closed channel
Merge pull request #34 from hannesg/close_channel_on_shtudown

Added ability to wait for correct shutdown