This demand for flavor—as CEO Brendan Foley calls it—lifted the company’s sales and profit, but wasn’t enough to offset rising costs and steep tariffs.