Close database connection after use