[CLEANUP] Extbase persistence classes

The classes contain wrong type hints and miss a lot of
checks whether the correct object is present.

Resolves: #57031
Releases: 6.2
Change-Id: I3d03c838b05529daf0da444119dd7f8dba6d5b8a
Reviewed-on: https://review.typo3.org/28489
Reviewed-by: Felix Oertel
Tested-by: Felix Oertel
Reviewed-by: Markus Klein
Tested-by: Markus Klein