Fix IndexOutOfBounds error when deserializing max_by/min_by aggregation state

It happens because deserialize mistakenly reads the length from the first
position in the block regardless of which position is being deserialized.

If the length of the first position is longer than the length of the current
position, the code tries to read beyond the end of the buffer.