[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.

Resolves: #44988
Releases: 6.0, 6.1

Change-Id: Ia4690fb0a68cd4d6832aef6712bc69adf00f8a5f
Reviewed-on: https://review.typo3.org/17848
Reviewed-by: Jigal van Hemert
Tested-by: Jigal van Hemert