Fix concurrency issue

As reported here: https://github.com/SamSaffron/message_bus/issues/18
Fix failing tests
Merge pull request #19 from victorarias/master

Fix threading issue in ConnectionManager