<!-- Describe the issue -->
Problem
After creating a new wallet and running a series of operations concluding with unloadwallet, the next time that wallet is loaded with loadwallet, bitcoin-qt crashes after the following assertion fires:
bitcoin-qt: wallet/db.cpp:236: BerkeleyEnvironment::VerifyResult BerkeleyEnvironment::Verify(const string&, BerkeleyEnvironment::recoverFunc_type, std::__cxx11::string&): Assertion `mapFileUseCount.count(strFile) == 0' failed.
Recreating
See gist: loadwallet-crash.sh
This fails reliably for me on v0.17.0.1 release binaries, and also on my local build of v0.17.1rc1, on 32-bit Whonix 13.