CxxUtils: Fix potential problem with inserting into an empty container.
If we do an emplace where:
- The map is empty.
- The insertion point is at the end of the map (so we need to reallocate)
- The last entry in the map (which has been removed) matches the new range being inserted
then we would return DUPLICATE rather than inserting new element.
Fixed, and add this case to the unit test. See ATR-27419.