There are two main changes: introduce LevelDbOptions to manage the leveldb::Options struct and changing CDBWrapper’s penv member to a unique_ptr. The first allows LevelDbOptions to destroy leveldb::Options members without CDBWrapper having to directly. The second change allows the leveldb::Env to be managed by penv. Both of these changes prevent a LeakSanitizer exception if the CDBWrapper ctor throws.
Fixes #22592