McDonald's reported better-than-expected profit and sales in the third quarter.