AT&T will be spinning off its WarnerMedia unit as part of a previously-announced $43 billion deal to merge its media business with Discovery.