Over 1,000 foreigners in S. Africa flee homes after attacks