afsql: check table in database with libdbi function in validate_table

Signed-off-by: Laszlo Budai <stentor.bgyk@gmail.com>
afsql: free db_res only if it is not NULL in validate_table
afsql: rollback if commit was failed within validate table
afsql: fixup

Signed-off-by: Laszlo Budai <stentor.bgyk@gmail.com>