ported stream engine fix from ZeroMQ

Ported ZMQ-465.

https://github.com/zeromq/zeromq3-x/commit/0c0a351fa5ffed3b66206eac6b77cef2fb316151