PepsiCo has posted a better-than-expected rise in profits for the third quarter.