Walgreens Boots Alliance (WBA), the owner of Boots, has agreed to a $10bn (£7.8bn) takeover by a US private equity firm.