tests: move pwalletMain to wallet test fixture
Scope the variable instead of using an external global; this is how test fixtures are intended to be used. Followup to #11713.
Backport of core PR11718
Reviewers: #bitcoin_abc, deadalnix, jasonbcox
Reviewed By: #bitcoin_abc, jasonbcox
Differential Revision: https://reviews.bitcoinabc.org/D3098