Buffer read fix.

It was possible that if the buffer was not complete on a pass of a read
that complete messages could be removed from the buffer without being
parsed.