Cleanup
Try to reproduce the bad file descriptor error
Fix bad file descriptor error

ZMQ was throwing a "Bad file descriptor" error when many requests are
made in a small time frame. This happened because each request creates a
new zmq context and a new socket within that context. By using a single
ZMQ context for all requests, the error dissappears.