Ab initio calculation of electron affinities of diamond surfaces