Do not use iterator on changed dict

Signed-off-by: Michal Čihař <michal@cihar.com>