Remove uses of chainActive and mapBlockIndex in wallet code
Summary:
This change removes uses of chainActive and mapBlockIndex globals in wallet code. It is a refactoring change which does not affect external behavior.
Backport of core PR14711.
Test Plan:
ninja all check-extended
Ran the tests with UBSAN and ASAN as well.
Reviewers: #bitcoin_abc, deadalnix
Reviewed By: #bitcoin_abc, deadalnix
Differential Revision: https://reviews.bitcoinabc.org/D5683