Several memory leaks fixed

Memory was being leaked in several locations in the ODBC driver,
mdbsql, and libmdb.  Used valgrind to find leaks and added functionality
where necessary to cleanup any allocated memory.  Added functionality
to the ODBC driver to allow it to clean up any allocated handles
following an improper shutdown.

Also, fixed some minor issues in ODBC driver, primarily the incorrect
row count handling after resetting a statement.

Extensive testing has NOT been done on these changes, but the library
now seems to be stable enough to use in long running processes without
any noticeable memory leaks (for well behaved ODBC apps, at least)