[BUGFIX] RootlineUtility wrongly handles group-type fields

\TYPO3\CMS\Core\Utility\RootlineUtility::enrichWithRelationFields()
tries to resolve relations to the current page record, including
fields with MM-relations. But it wrongly tests only for the
"foreign_table" property, whereas group-type fields will use the
"allowed" property.

This patch checks for "allowed" first and falls back on
"foreign_table". Furthermore a check is added to ensure the final
implode is indeed working on an array.

Resolves: #50396
Releases: 6.3, 6.2, 6.1
Change-Id: I43427061a5051298a25e45584aa995846ebb877c
Reviewed-on: http://review.typo3.org/29493
Reviewed-by: Jacob Rasmussen <jacob@omnius.dk>
Tested-by: Jacob Rasmussen <jacob@omnius.dk>
Reviewed-by: Mattias Nilsson <tollepjaer@gmail.com>
Tested-by: Mattias Nilsson <tollepjaer@gmail.com>
Reviewed-by: Markus Klein <klein.t3@reelworx.at>
Tested-by: Markus Klein <klein.t3@reelworx.at>