close db on exit (so that some cleanup can be done)