Officials involved in flawed Afghan elections are being removed ahead of next month’s run-off, the UN says.