[backport#14268] Introduce SafeDbt to handle DB_DBT_MALLOC raii-style
Summary:
This provides additional exception-safety and case handling for the proper
freeing of the associated buffers.
https://github.com/bitcoin/bitcoin/pull/14268/commits/1a9f9f7e5e2e73fb832f5b96ad7e9e57954f3f3c
Depends on D7321
Partial backport of Core PR14268
Test Plan:
ninja check check-functional
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Differential Revision: https://reviews.bitcoinabc.org/D7322