The social-media company will avoid a landmark trial that will weigh online platforms’ liability for teen addiction.