Streaming company’s decision ends months-long battle to buy parent of CNN, HBO and franchises like Harry Potter