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


Active is reduced in the zmq internal thread in terminated, potentially to zero.
If the user thread is in send() between lines 109 and 116, then the old code "(current+1) % active" is a divide by 0 - and crashes the program.