Superconductivity and anomalous phonon dispersion in TaC