Recursive resync would validate hierarchy info of all IDs in Main, when
it should only handle the ones in its currently processed 'library level'.
Otherwise, it could incorrectly clear hierarchy info from 'more local'
liboverrides that were still to be resynced, leading to issues like
left-over 'orphaned'/unused liboverrides, needless renames, etc.
Also contains a few 'logical mistakes' fixes in the resync code, though
these did not seem to have any known practical effect.