Resolved concurrency issue when registering and publishing messages

https://github.com/hyperletter/Clr/issues/3