The BerkeleyBatch class has 4 static functions that operate on BerkeleyDatabase or BerkeleyEnvironment. It doesn't make sense for these to be standalone nor for them to be static functions. So instead, move them from BerkeleyBatch into BerkeleyDatabase and make them member functions instead of static. BerkeleyBatch::VerifyEnvironment and BerkeleyBatch::VerifyDatabaseFile are combined into a single BerkeleyDatabase::Verify function that operates on that BerkeleyDatabase object. BerkeleyBatch::Rewrite and BerkeleyBatch::PeriodicFlush both took a BerkeleyDatabase as an argument and did stuff on it. So we just make it a member function so it doesn't need to take a database as an argument.
Backport of core PR19324.
Depends on D8616.