J.P. Morgan upgraded Cheesecake Factory’s stock, as weight-loss drugs and cautious consumers make the restaurant industry more anxious.