Pharmacy chain Walgreens announced Thursday that it would close a significant number of its U.S. stores, after cutting its full-year profit outlook.