Check for and handle ZMQ errors.

Log ZMQ errors and deal with them by creating a new ZMQ PUB socket in
most situations.