The tentative deal would close an investigation by nearly three dozen states into the company’s marketing and sales practices.