db_handler: close file in checkdb function