[backport#17261 2/13] Locking: Lock cs_KeyStore instead of cs_wallet in legacy keyman
Summary:
This commit only affects locking behavior and doesn't have other changes.
https://github.com/bitcoin/bitcoin/pull/17261/commits/fadc08ad944cad42e805228cdd58e0332f4d7184
Partial backport of Core PR17261
Test Plan:
cmake -GNinja -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS=-Werror ninja all check check-functional
Reviewers: #bitcoin_abc, Fabien, deadalnix
Reviewed By: #bitcoin_abc, Fabien, deadalnix
Subscribers: Fabien
Differential Revision: https://reviews.bitcoinabc.org/D7838