[FIXED JENKINS-18329] - Prevent ConcurrentModificationException

Replace Iterator with ListIterator and use iterator methods for adding
and removing. This should fix any ConcurrentModificationExceptions
Merge branch 'JENKINS-18329'