fixes #628 Hang in closing REQ
fixes #628 Hang in closing REQ

This adds a proper boolean condition for the pipe being closed
(removing the unused sending flag), and adds checks for both the
pipe closed and the socket closed flags at key points.

nanomsg/nng,nanomsg/nng,nanomsg/nng,nanomsg/nng