Corrected compile errors in case DB_ENABLE_STATS is defined

Signed-off-by: Haru <haru@dotalux.com>