Calculation of the electronic structure of charged vacancies in semiconductors: the zinc vacancy in ZnSe