destroy only if associated record is destroyed

fixes #5147

If any of the associated records fail to destroy then do not destroy the record.

I'll clean up the commit message and will add a changelog  if there is an interest in the patch.

/cc @carlosantoniodasilva . You participated in the discussion of the original issue.