This also replaces two sleep calls in functional tests with wait_until
signrawtransactionwithkey
TestShell