Settings: Ensure fields are overriden and not merged when using arrays

In the case you try to put two settings, one being an array and one being
a field, together, the settings were merged instead of being overridden.

First config file
my.value: 1

Second config file
my.value: [ 2, 3 ]

If you execute

settingsBuilder().put(settings1).put(settings2).build()

now only values 2,3 will be in the final settings

Closes #6887
Maybe we should clone the map first in order not to modify the parameters of this method?