[BUGFIX] Fix attaching objects to a existing objectstorage

This is a follow up to "Optimize persisting a dirty objectStorage"
https://review.typo3.org/#/c/3390/
A new relation should be attached if the cleanstate relation position
is NULL instead of updating a non existing one.

Also creating new object with children attached is fixed now.

Releases: 6.1
Fixes: #47195
Fixes: #47197
Relates: #28091
Change-Id: I2a4a7602aeb8d9f4163fed36640ec830fe9ab300
Reviewed-on: https://review.typo3.org/19940
Reviewed-by: Wouter Wolters
Reviewed-by: Georg Ringer
Tested-by: Georg Ringer