This commit does not change behavior, it just moves code from
CWallet::CreateWalletFromFile to CWallet:::AttachChain so it can be updated in
the next commit.
This commit is most easily reviewed with
"git diff -w --color-moved=dimmed_zebra" or by diffing CWallet:::AttachChain
against the previous code with an external diff tool.
This is a partial backport of core#20773
https://github.com/bitcoin/bitcoin/pull/20773/commits/44c430ffac940e1d1dd7f5939a495470bc694489
Depends on D17642