call zmq_errno as soon as possible

avoids errno being clobbered by other operations before it's retrieved
Merge pull request #483 from minrk/checkrc

call zmq_errno as soon as possible