Ported extension of ExtrusionEntityCollection::flatten() to disable flattening of no_sort() collections.