Copy dict items before modifying iteration