[backport#13136] Fix flake8 warnings in several wallet functional tests
Summary:
Note: This backport apparently was skipped due to being (mostly) irrelevant changes that our linter takes care of anyway. But there was one line of code changed on wallet_basic and a few variable name changes that are being a pain, so I'm bringing in the relevant parts.
Backport of Core PR13136 (hiding whitespace changes makes this easier)
Test Plan:
ninja all check check-functional
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Subscribers: Fabien
Differential Revision: https://reviews.bitcoinabc.org/D7716