QA: Fix race condition in wallet_encryption test
Summary:
There is some imprecision probably in the internal HTTPRPCTimer class (haven't exactly figured out where). But we can't expect that waiting exactly 2 seconds right after calling walletpassphrase(2) will result in a locked wallet due to the nature how we internally handle threads/timers. The wallet_encryption test fails regularly in CIs.
Backport of core PR16420
https://github.com/bitcoin/bitcoin/pull/16420/files
Test Plan:
for i in {1..100} do ./test/functional/test_runner.py wallet_encryption done
Reviewers: #bitcoin_abc, deadalnix, jasonbcox
Reviewed By: #bitcoin_abc, jasonbcox
Differential Revision: https://reviews.bitcoinabc.org/D3702