Protect against segmentation fault with merge keys

Previously any merge key found in a mapping was expected to have a RHS of an
array. This patch adds a validation that the RHS is indeed an array before
attempting to merge the RHS values into the current mapping.

Bug: 64019