Fix potential read overflow in skip_varint