The discount chain said it agreed to a sale transaction with an investment firm which would allow hundreds of stores to stay open by transferring its property to other retailers and companies.