Phonon self-energies in semiconductors: anharmonic and isotopic contributions