to allow passing rpcwallet independently from the -rpcwallet user option, and to
move the logic to the top-level layer where most of the other option args are
handled.
This is a backport of Core PR18594 [2/6]
https://github.com/bitcoin/bitcoin/pull/18594/commits/743077544b5420246ef29e0b708c90e3a8dfeeb6
Depends on D9237