Fix a race when a message is sent as the last connection is lost.

We have found crashes in tardispickle in production and in unit test cases with divide by zero crashes in libzmq.
With the unit test and a debug build of libzmq we deduced the following fault in lb.cpp

Active is reduced in the zmq internal thread in terminated, potentially to zero, as a result of the application receiving thread closing its socket.
If the application sending thread is in send() between lines 109 and 116 as active is reduced to zero, then executing the old code
 "(current+1) % active" results in a divide by 0 - and crashes the program.

By inspection, the same fault could also happen in fq.cpp, so the same fix is applied to remove the possibility of divide by zero as active becomes 0 here also.

NOTE WELL:
These changes only address the divide by zero error, and do not address
any other issues associated with accessing the last pipe after it has been
terminated.