AG Barr has increased volumes and revenue in first-half results as rising costs bit into profits.