Close the db when done, solve too many open files