After a strong start to the year for US stocks, the engine that has driven them upward for the better part of four years shifted nearer to “idle” in the third quarter. The S&P 500 was able to climb to fresh highs in August, helped by technology stocks, but the gains wouldn’t hold.