The unwavering TV writer-producer, winner of 10 Emmys, butted heads with networks and almost always won.