Walgreens plans to close about 1,200 locations over the next three years as the drugstore chain seeks to turnaround its struggling U.S. business.