Stocks close out their worst quarter since 2022 amid tariff uncertainty