d-band effects in the lattice dynamics of transition metal carbides