[Reviewer: Rob][From: Alex] Fix intermittent UT race condition

Change the affected tests to mock out the ZMQ interface.

I tested this by:

* Hacking the STATS_PERIOD to 0.1s to reproduce the failures.
* Checking that this codes fixed the tests.