Fix endless loop in basic loop fusion