Deduplicate settings merge code
Summary:
Get rid of settings merging code in util/system.cpp repeated 5 places,
inconsistently:
- ArgsManagerHelper::GetArg
- ArgsManagerHelper::GetNetBoolArg
- ArgsManager::GetArgs
- ArgsManager::IsArgNegated
- ArgsManager::GetUnsuitableSectionOnlyArgs
Having settings merging code separated from parsing simplifies parsing somewhat
(for example negated values can simply be represented as false values instead
of partially cleared or emply placeholder lists).
Having settings merge happen one place instead of 5 makes it easier to add new
settings sources and harder to introduce new inconsistencies in the way
settings are merged.
This commit does not change behavior in any way.
This is a partial backport of Core PR15934 : https://github.com/bitcoin/bitcoin/pull/15934/commits/7f40528cd50fc43ac0bd3e785de24d661adddb7a
This PR had to be modified due to ClearForcedArg and ForceSetMultiArg not being supported by Core.
Depends on D5905
Test Plan:
make check
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Differential Revision: https://reviews.bitcoinabc.org/D5903