Plug heartbeat sender leak in clean_up_on_shutdown
Merge pull request #199 from m-o-e/fix-threading

Plug heartbeat sender leak in clean_up_on_shutdown