GSK has agreed to pay up to $2.2 billion to settle most lawsuits in US state courts claiming that a discontinued version of the heartburn drug Zantac caused cancer, the company announced on Wednesday.