Thousands of people from other African countries have left South Africa ahead of Tuesday's deadline set by anti-migrant groups.