Google will pay more than $40 million to support South African news media, many of them floundering in a digital age, the country’s competition authority said Thursday.