Fix up how test db is cleaned up

Our brute-force db cleaning algorithm needs to run not all in the same
transaction.
Fix record_an_exchange tests