[BUGFIX] Reset legacy fields if no relations are found

If you add multiple images to a tt_content element
but mark all of them hidden, an image is shown which has
the uid of the number of images added to the element.

This is the case because TYPO3 puts the relation count in the
field and the frontend adapter service does not reset
the field if no relations are found.

The solution is to set the legacy fields in any case.

This change adds a test which fails without a fix
and another test which shows that the original behaviour
is not affected.

Change-Id: I2cacfe185e1371331ab7564413e43c7d6cce8556
Resolves: #44988
Releases: 6.0, 6.1
Reviewed-on: https://review.typo3.org/17871
Reviewed-by: Jigal van Hemert
Tested-by: Jigal van Hemert