Variational integrator based optimal feedback control for constrained mechanical systems