U.S. Locks in Rare Earth Deal with Ukraine, but Payoff May