Replace use of db.conn.close() as it is not supported in the new backend