Add additional check before potentially array_merging non-array values

This was/is breaking https://integration.wikimedia.org/ci/job/mwext-Thanks-testextensions-master/129/consoleFull

Change-Id: If82521da4a16779aa36f5237952593fd8cdd81f6
Merge "Add additional check before potentially array_merging non-array values"