core: fix the merging of identical objects in presence of Misc objects

If object A contains B + I/O as children, we can "ignore" I/Os and still
try to merge A and B. We now do the same for Misc objects without cpusets
instead of I/Os.

This fixes a corner case when export/reimport to XML creates a slightly
different topology (making hwloc_insert_misc fail inside a Linux cgroup).

Thanks to Dave Love for reporting the problem.

Fixes #118

(cherry picked from commit 650371e1159fb3826afae8842545c4d16bdad1c8)
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)