[backport#16465 2/3] test: Replace fragile "rng" with call to random()
Summary:
This is a partial backport of Core PR16465 - part 2 of 3
Commit https://github.com/bitcoin/bitcoin/pull/16465/commits/fa79af298917d501cee26370fdf9d44d05133d15
Depends on D8054
Test Plan: ninja && test/functional/test_runner.py wallet_import_rescan.py
Reviewers: O1 Bitcoin ABC, #bitcoin_abc, deadalnix
Reviewed By: O1 Bitcoin ABC, #bitcoin_abc, deadalnix
Differential Revision: https://reviews.bitcoinabc.org/D8055