Anharmonic effects in the phonon spectra of sodium chloride