For a few tense days last month, it looked like a roaring bull market for U.S. stocks was coming to an end after an impressive 2½ year run.