EMI: Avoid deleting pool objects while iterating

As discussed in IRC: Apparently it is not safe to delete pool objects while iterating the pool with foreach(). Collect the objects to be deleted in a list and destroy them afterwards.