Code factorisation

Call mdb_sql_reset from mdb_sql_exit
This does some harmless extra stuff, like reseting column counts.
Not worth the trouble to code it twice.
Fix memory leak

Free sql->cur-table->sargs_tree
Thanks William Rogers.