A new accord ends a bitter power struggle and gives Rupert Murdoch’s elder son control of the family’s media empire.