South Africa has closed its border with Mozambique amid post-election unrest in the neighbouring country escalated.