core: reorder children in merge_useless_child() as well

When ignore_keep_structure is enabled, intermediate level can disappear
between parent and child, making the new child complete_cpuset smaller,
causing the child list to require a reorder just like in remove_ignored().

(cherry picked from commit 88afbe6b62d1fae99bf36b8f03e26eff37f08240)

Embed this related commit:
core: abstract out reorder_children(), needed when merging modifies the list of children
(cherry picked from commit 14db82d3917c5de40dfe12ead316f3fc602197f4)