Approximate solutions of vector fields and an application to Denjoy-Carleman regularity of solutions of a nonlinear PDE