WBD agreed to sell its film studio and streaming service HBO Max to Netflix, and plans to spin out Discovery Global, with its TV networks such as CNN and TNT.