[BUGFIX] Prevent call of updateReferenceIndex on unknown object

Fixes: #46418
Releases: 6.1, 6.0

Change-Id: I20ab919c2290edcf6478f8edc7a0eafe2bac7cbb
Reviewed-on: https://review.typo3.org/19032
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Reviewed-by: Wouter Wolters
Reviewed-by: Stefan Neufeind
Reviewed-by: Frans Saris
Reviewed-by: Marc Bastian Heinrichs
Tested-by: Marc Bastian Heinrichs
[TASK] Optimize persisting a dirty objectStorage

This change optimizes persisting a dirty objectStorage
by not removing and inserting/updating all relations,
but insert/update/remove only new/dirty relations.
In the issue a wiki page is linked with some additional infos.

Resolves: #28091
Releases: 6.1
Change-Id: I1e861b62df0379eb84126c7f70f82287e23f0bdd
Reviewed-on: https://review.typo3.org/3390
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
Reviewed-by: Tymoteusz Motylewski
Tested-by: Tymoteusz Motylewski
Reviewed-by: Marc Bastian Heinrichs
Tested-by: Marc Bastian Heinrichs