HJB equations for the optimal control of differential equations with delays and state constraints, I : regularity of viscosity solutions