Migrated the template function FlushDigestTableToDisk to use RAII-based
prepare_v2. This function is instantiated for both MySQL and PostgreSQL,
eliminating 8 deprecation warnings (4 instantiations x 2 prepare_v2 calls).
The RAII pattern ensures automatic cleanup and eliminates manual
(*proxy_sqlite3_finalize) calls.