Add receive buffer method and fix bugs about checking return value of zmq_recvmsg and zmq_sendmsg