Fix concurrent modification exceptions when using some foreach loops.
Fix concurrent modification exceptions when using some foreach loops.


Former-commit-id: 093526780a2b75d64f6163b967ad2293402b45a6
jolie/jolie,jolie/jolie,jolie/jolie