AG Barr has recorded an increase in first-half net profits, but said it remains cautious about the second half of the year.