LT-14926, use proper Replace to avoid delete side effects

The old code crashed because deleting one item (before adding
another back) went through an intermediate state with only one
item, triggering a side effect that deleted the owning relation.

Change-Id: Idc59787f3194e401415ce30292ca22a2fb5420a4