Mean-field study of the Swendsen-Wang dynamics