[TASK] Make Flow Package HHVM compatible

HHVM doesn't support calling array functions like key()
on objects, we need to cast object to array first.

Resolves: #57993
Related: #57992
Releases: 6.2
Change-Id: I8551860b103745622624dafd8f285db1a7b8f275
Reviewed-on: https://review.typo3.org/29508
Reviewed-by: Stefan Neufeind
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring