Fixed memory leaks in db, free db structures at end of testdb program to support valgrind memory profiling.