For `CopyVarint{32,64}()`, apply the same optimization as in `ReadVarint{32,64}()`: do not pull the maximum possible varint length if a valid varint is definitely present in a shorter buffer.
For `CopyVarint{32,64}()`, apply the same optimization as in
`ReadVarint{32,64}()`: do not pull the maximum possible varint length
if a valid varint is definitely present in a shorter buffer.

Also, rewrite the low level implementation of `CopyVarint{32,64}()`
to match the current style of `ReadVarint{32,64}()`.

PiperOrigin-RevId: 311294054

google/riegeli,google/riegeli,google/riegeli,google/riegeli