Former Brazilian football player Dani Alves has had a rape conviction against him quashed upon appeal.