Cherry picking changes from libzmq master