C1;1-smoothness of constrained solutions in the calculus of variations withapplication to mean field games