Avoid a bug during link integrity check when a source or target of the
  reference has been already removed during the deletion process.