TMDM-7590: "integrity constraint check failed when deleting record but there' no fk point to it"

Deleting record in relation table record when no longer necessary (both single and repeatable FKs).
(https://jira.talendforge.org/browse/TMDM-7590)

cherry picked from 1abaaef792808099499580d63825dc845bbddacd

Conflicts:
	org.talend.mdm.core/test/com/amalto/core/query/InheritanceTest.java
TMDM-7653: "update record failed when element is reusable type"

Fix issue in scattered mapping stategy when a unary element's type changes in an update (missing type change checks).
(https://jira.talendforge.org/browse/TMDM-7653)