Check number of bytes received in messages.*Message.receive_bytes()

And consistently use the method to read bytes from sockets.