CRM-12715 fix merge on multi-record entities