Convergence of the forward-backward sweep method in optimal control