Canadian retailer Sobeys has agreed to sell 23 stores in order to gain competition clearance for its acquisition of Safeway Inc's business in the country.