Iterate over a copy of a list when removing items. (similar to 201869a)