Closing database connections with "finally" if they are still open