US stocks close at an all-time high just months after plunging on tariff fears