Fix two more bugs.

Unfortunately, two more subtle bugs to fix:

- If the encoded protobuf message is only three bytes long (or less),
  not only the whole protobuf will fit into headerBuf, but also the
  beginning of the next length varint. This will completely wreak
  havoc in the read process. (This bug never bit us in Prometheus
  because the protobuf messages were all long enough. But protobufs in
  general can be very small (0 bytes in fact). I added a test for
  that.)

- If the reader stops in the middle of a length varint, it will
  interpret the null byte that is already in headerBuf as the final
  byte of the varint, which again wreaks havoc. (This bug only shows
  up in Prometheus after
  https://github.com/prometheus/prometheus/commit/dfb9c2a072d5c1003e78c4921988c21bc76ab07a
  , and it is very rare... needs very unlucky fragmentation on the
  network.)

Solution to the first bug is to read byte-wise, which is slightly less
effective, but simplifies the code later, because we don't "overshoot"
anymore. Solution to the second bug is to only read the parts of
headerBuf that have been written to.
GitHub won't let me make this comment on line 30, where I want to:

Can you please include a note about the reading behavior and this blocking until it successfully reads sufficient bytes to decode a message (even if empty message) or end of stream occurs, or an error occurs.  The old contract, while wrong, was never conveyed.  We should take this opportunity to do right and let users know what the behavior is for our reader.