Meta agreed to change Instagram and Facebook in a settlement resolving a case brought by states that accused the company of designing addictive products for children.