Commit e545dedf72bff2bd41c93c93eb576929fce37112 moved TransactionAddedToMempool
to the background scheduler thread. Thus, adding a transaction to the mempool will no longer add it to the wallet immediately. Functional tests, that sync_mempools
and then call into wallet rpcs will race against the scheduler thread.
Fix that race by flushing the scheduler queue.