Replace get_conn with context manager.