wallet: Call load handlers without cs_wallet locked
Summary:
Don't have cs_wallet locked while calling each context.wallet_load_fns. A load handler can always lock cs_wallet if needed. The lock was added in 1c7e25d to satisfy TSAN. With 44c430f most of the code requiring the lock is in CWallet::AttachChain. A comment is added to warn about wallets_mutex and cs_wallet lock ordering.
Backport of core#22868.
Test Plan:
With clang and debug:
ninja all check-all
Run the tsan build.
Reviewers: #bitcoin_abc, PiRK
Reviewed By: #bitcoin_abc, PiRK
Differential Revision: https://reviews.bitcoinabc.org/D17980