Walgreens Boots Alliance is to be acquired by Sycamore Partners as it looks to turn itself around after years of losing money.