AG Barr is to cut 10% of its workforce before the end of the year amid a declining UK market that hampered H1 sales and profits.