walletdb: Move Db->open to BerkeleyDatabase::Open
Summary:
Instead of opening the Db handle in BerkeleyBatch, make BerkeleyDatabase
do that.
This is a backport of core#19335 [3/5]
https://github.com/bitcoin/bitcoin/pull/19335/commits/d86efab37002841fd059251672e1ec1a977b743f
Depends on D10035
Test Plan: ninja all check-all
Reviewers: #bitcoin_abc, majcosta
Reviewed By: #bitcoin_abc, majcosta
Subscribers: Fabien
Differential Revision: https://reviews.bitcoinabc.org/D10036