afsql: validate_table fix

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>