They finalized a cable distribution deal in which Warner locks in higher fees for its networks and resolves a legal battle over a new “Harry Potter” TV series.