Frictionless and frictional ThermoElastic Dynamic Instability (TEDI) of sliding contacts