Judge Nathan Erasmus said online harassment threatened trust in South Africa’s justice system and caused ‘suspicion’