Core: explicitly close database connections at the end of each client run