Fix 'package extract' with multiple explicit entries

* before adding a child to a parent entry, we need to check if the
  parent already contains that child, as otherwise duplicate children 
  with identical names would be added, which in turn messes up the
  handling of the entries that are to be extracted