Thousands of South Africans have been lining up for water as the country's largest city, Johannesburg, confronts an unprecedented collapse of its water system affecting millions of people.