Fix bug: ``CopyModifyMergeRepositoryTool.manage_setTypePolicies`` method modifies sequence while iterating over it.

Added test to demonstrate the problem.