Although Stokes' theorem, neither in its original formulation for three-dimensional vector fields nor in its generalized form, applies directly to the cited statement, you are correct in seeing some common features. Indeed, in the case of Stokes' theorem, as in the case of the closed thermodynamic cycle, one has to provide a meaning to a line integral of a differential form. By providing a meaning I mean that we need to show that a discrete sum evaluated over a piecewise polygonal approximation of the curve is well-behaved in the limit where the number of segments diverges, getting closer and closer to the curve.
This is a double-sided problem. On one side, it is the purely mathematical problem of finding the most general hypotheses to prove the result. A convenient set is the same required for the lemmas used to prove Green's theorem. In particular, the curve should be a rectifiable, positively oriented Jordan curve in the plane.
On the other side, we have the problem of justifying the validity of the mathematical hypotheses in the physical case. Such a step cannot be, by its nature, a purely logical deduction but should be treated as a probabilistic inference justified by the coarse-graining implicit in every measurement and by the consistency with experimental facts of the consequences.