South Africa's highest court has ruled that a vote of no-confidence against President Jacob Zuma can be held in secret.