Issue #1570510 by OWast, mikran: Fix an issue with relations getting deleted when endpoint entity was deleted.