[DDC-2624] Fix bug when persistent collection is cloned and used in a new entity.
Fix tests in 2.4 branch
Merge branch 'DDC-2624' into 2.4