Given an array of dictionaries and an optional key mask compute a values array
containing referenced values, along with mappings from the [DictionaryArray]
keys to the new keys within this values array. Best-effort will be made to ensure
that the dictionary values are unique
A weak heuristic of whether to merge dictionary values that aims to only
perform the expensive merge computation when it is likely to yield at least
some return over the naive approach used by MutableArrayData