TPS-729 [5.5.1]Rollback error may leave MDM server in inconsistent state(TMDM-7719)

TMDM-7719: "Rollback error may leave MDM server in inconsistent state"

Backport changes from 5.6 branch for safety code added on rollback.
(https://jira.talendforge.org/browse/TMDM-7719)
(cherry picked from commit 02001f6)