US stocks end with losses as inflation climbs, Trump threatens more action against Iran