Cherry picking fixes from libzmq