Since #33032 landed (in-memory SQLiteDatabase via SQLITE_OPEN_MEMORY), the intermediate wallet built during exportwatchonlywallet can live entirely in memory instead of being written to the wallets directory as a temporary file.
The temp wallet is a pure build artifact: it is populated with descriptors, transactions, and address book data, then immediately discarded once BackupWallet() copies its contents to the destination file. Making it in-memory removes all on-disk footprint and eliminates the cleanup_watchonly_wallet RAII handler — along with the wallet_path and cleanup_files variables it needed — which previously ensured the temp files were deleted on both success and failure paths.
This PR introduces InMemoryWalletDatabase (a minimal SQLiteDatabase subclass) and MakeInMemoryWalletDatabase() factory in sqlite.h/cpp, following the same pattern as MockableSQLiteDatabase / CreateMockableWalletDatabase(). MockableSQLiteDatabase now derives from InMemoryWalletDatabase, removing its redundant Files() override.
Suggested by Sjors in #32489 (comment).
Also fixes a related issue found (by Sjors) during review:
SQLiteDatabase::Open()(the no-arg public override) hardcoded 0 asadditional_flagswhen reopening after a failedTxnAbort(), which would reopen an in-memory database as on-disk. Fixed by storingm_additional_flagsin the constructor and using it in the reopen path. For in-memory databases, both theforce_conn_refreshpath and the publicOpen()now throw instead of silently creating a fresh empty connection. A regression test for theOpen()throw is included in a separate commit.
As a follow-up, InMemoryWalletDatabase could replace MockableSQLiteDatabase in src/bench/ (5 files, 6 call sites), since benchmarks don't need mock-specific behaviour and benefit from using the same in-memory path as production code.