An updated version of #10499. Delete in memory association record.

When target record is deleted then in-memory association
record should be deleted for hm:t case.

Fixes #9548.