Do not alter the ParentList being iterated over (#1083581)

Removing items from a list that is being iterated over may result in various
weird, unexpected and hard to track issues (see rhbz#1083581 and rhbz#1098185).