The social media platform will pay $400m in an out-of-court settlement over claims that it violated minors’ personal data protections