Mediemogulen Rupert Murdoch lämnar rollen som ordförande för både Fox och News Corp, uppger bolaget.