Instead of having WalletBatch construct the BerkeleyBatch, have
BerkeleyDatabase do it and return a std::unique_ptr<BerkeleyBatch>
This is a backport of core#19325 [2/2]
https://github.com/bitcoin/bitcoin/pull/19325/commits/b82f0ca4d5465b36debb6c57f335bdccf4899c49