Smooth densities for degenerate stochastic delay equations with hereditary drift