guard all ZMQ operations by a single shared lock

I suspect this fixes the following dp bug report:
https://github.com/DroidPlanner/droidplanner/issues/800