Properties of HxTaS2: Correlation between the superconducting Tc and an electronic instability in layer compounds