Sort AppendOnlyMap in-place