They will sell the stores as part of a deal to divest the grocery giants’ planned merger.