A tight-binding molecular dynamics study of phonon anharmonic effects in diamond and graphite