Hershey has outperformed the S&P 500 over the past year, but analysts are cautious about the stock’s prospects.