This patch moves the checking for too large offsets into merge sections earlier.
Without this change the large offset generated in the added test-case will cause an assert (as it happens to be a value reserved as a "tombstone" in the DenseMap implementation) when OffsetMap is queried in getSectionPiece().
To simplify the code and avoid future mistakes I have refactored so that there is only one function that looks up offsets in the OffsetMap.