Second attempt at fixing #39

Fixes a race condition in hive_pubsub causing excessive crashes.