fixed topic hierarchy

If top level topic is empty (all subscribers were unsubscribered),
messages[topic] is empty Array. So function messageHasSubscribers will
return false, because topic found and have 0 subscribers, so here will
not be check for lower topic levels.
making tests happy
Merge pull request #1 from codio/fix_topic_hierarchy

fixed topic hierarchy