[BUGFIX] Follow-up to l10n_mode=exclude for record titles

Fix a possible warning in the new method and simplify test
cases a bit.

Change-Id: Ie9ee3c1b52d3a692c23428f21e3fb7311da9cb2a
Resolves: #33499
Releases: 6.2
Reviewed-on: https://review.typo3.org/29492
Reviewed-by: Andreas Wolf
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel