Fixed bad error messages in sql.c
Fixed unfreed memory in sql.c tests
Streamline SQL db function call

SQL db functions and regular db drivers are now called the same way.