The grocery and pharma businesses are performing steadily, even if the company, with its 2,700 stores, may be running out of spots to build new ones