The S&P 500 ends its longest bear-market run since 1948. Here’s a look at how the benchmark has fared after waving goodbye to past bears.