Fixing cascade behaviour for package config.

Normal configs were cascading with array_replace_recursive(), which
merged recursive arrays nicely, however Package configs were using
array_merge(), which only merged the top-level arrays. This is
inconsistent across the configuration handling, and is confusing for
users trying to override specific package configuration.

It looks like this fix was proposed in Issue #757, but missed when the
Issue #1225 was proposed, considered a duplicate, and eventually
merged.
Merge pull request #5531 from valorin/bugfix-package-config-cascade

Fixing cascade behaviour for package config.