U.S. stock markets erased all of their 2018 gains on Wednesday, rattling global investors with a selloff that spread into Thursday’s Asian session.