First of all, let me say what doesn't work, but I think it's an interesting application of physics to knot theory (and apparently the original source of Gauss's linking integral). Suppose you have an oriented knot $K$ in $\mathbb{R}^3$. Imagine replacing $K$ with an infinitely thin perfectly conductive metal wire, and give it some nonzero current. The magnetic field in the complement of $K$ has two interesting properties: (1) the curl of the magnetic field is 0, and (2) by Ampere's law the line integral along a curve in the complement of $K$ of the magnetic field is proportional to the linking number of the two curves (and with the right choice of current along $K$, it is the linking number). By thinking of the magnetic field as a $1$-form $\tau$ rather than a vector field, then you can calculate linking numbers by the integral $\int_\gamma\tau$. However, $\tau$ has unbounded support, which is why this doesn't work for you.
The main idea to get bounded support is to find a form that is supported in a neighborhood of a Seifert surface for $K$: we want to sort of "concentrate" the form to be only near the surface. It seems you are interested in $K=S^1$, the standard circle in the $xy$ plane. It has a Seifert surface which is the standard $D^2$ in the $xy$ plane.
One thing to think about is that $\tau$ is supposed to be a closed $1$-form. In a simply connected region of $\mathbb{R}^3-S^1$, that means it is the exterior derivative of some scalar function. Think about how you can get such a scalar function: you choose a point (the "basepoint") then to get the value of the scalar function elsewhere, you take the line integral from the basepoint to the point in question along a path that lies inside the simply connected region. If you don't stay inside the simply connected region, however, the value of the integral might change by an integer amount, depending on linking numbers. What this all means is that we can think of $\tau$ as being the exterior derivative of a scalar function $\theta$ with values in $\mathbb{R}/\mathbb{Z}$ (real numbers up to addition by an integer). I'm calling this $\theta$ because it is, in a sense, meant to be like the angle (in revolutions rather than radians) that a given point is around the knot with respect to $D^2$.
By the magnetic field point of view, take $\phi$ to be a $\mathbb{R}/\mathbb{Z}$-valued scalar function whose exterior derivative is the magnetic field that calculates linking numbers, where $\phi=0$ along $D^2$. Let $f(x)$ be a smooth function such that $f(x)=0$ for $x\leq -\epsilon$ and $f(x)=1$ for $x\geq \epsilon$, with $0<\epsilon<1/2$. For example, the integral of a bump function, suitably scaled. Then, let
$$\tau = d(f\circ\phi).$$
What's going on? $f$ is a reparameterization of the output of $\phi$ so that away from a neighborhood of $D^2$ the "angle" value is constant. This concentrates all the interesting behavior of $\phi$ near $D^2$ and gives us a closed 1-form $\tau$ with bounded support. (Technical note: to make sense of $f\circ\phi$, we need to represent the value of $\phi$ in an interval centered at $0$.)
Perhaps unfortunately, $\phi$ derived from a magnetic field can't be written in terms of elementary functions. For sake of exercise, let's come up with another one that's easier to write down. Consider the spheres which contain $S^1$. These are spheres with a center on the $z$-axis and which intersect the unit circle in the $xy$-plane; let's also include the $xy$-plane itself as a kind of degenerate sphere. Given a point in $\mathbb{R}^3-S^1$, then exactly one of these spheres contain that point. The tangent plane of the sphere at $(1,0,0)$ determines the sphere, too, and you can parameterize them by a unit vector that's orthogonal to $S^1$, and you can parameterize unit vectors by angles (a technical note: you need two copies of the $xy$ plane, for the two choices of surface normal, to make this actually work). All of this gives a way to construct a $\theta$ function. Sparing you the details, I got
$$\theta=\frac{1}{2\pi}\arctan\frac{-2z}{1-x^2-y^2-z^2}$$
with the understanding that $\arctan\frac{b}{a}$ means the angle of the vector $(a,b)$, or in other words the argument of the complex number $a+bi$. (This version of arctan is sometimes known as atan2 in computer languages.)
Then, another option for $\tau$ is
$$\tau=d(f\circ\theta).$$
I have to warn you that I didn't verify I got the signs right. This might be negative of a linking number $1$-form.
There are plenty of other $\tau$ forms that would work, too, though the difference between any two of them is the exterior derivative of an $\mathbb{R}$-valued scalar function.