I couldn't resist putting the sledgehammers to work that Robin Ekman alluded to, and I will try to present their general argumentation in a way one can understand without knowing all the details, but I don't intend to presume that this is in any sense a better answer, it is simply one that shows which things one must know to rigorously understand the weird statement that "sometimes there isn't, but sometimes there is a function so that $\nabla f = A$".
We consider vector fields $A^i$, by the Euclidean metric, to be equivalent to their dual 1-forms as per $A_i = A^i$. On 1-forms on 3D manifolds $\mathcal{M}$, we have an exact cochain complex of p-forms (denoted $\Omega^p(\mathcal{M})$) [with $d^p$ being the exterior derivative on p-forms]
$$ \Omega^0(\mathcal{M}) \overset{\mathrm{d^0}}{\rightarrow} \Omega^1(\mathcal{M}) \overset{\mathrm{d^1}}{\rightarrow} \Omega^2(\mathcal{M}) \overset{\mathrm{d^2}}{\rightarrow} \Omega^3(\mathcal{M})$$
As is usual for such things, we can take the cohomology of such a cochain complex, defined as $H^p(\mathcal{M}) := \frac{\mathrm{ker}(d^{p})}{\mathrm{im}(d^{p-1})}$. It can be shown that this is, by the Eilenberg-Steenrod axioms, an ordinary cohomology theory, thus the same as every other ordinary cohomology theory of $\mathcal{M}$. (this deRham cohomology has naturally coefficients in $\mathbb{R}$ instead of $\mathbb{Z}$, but that is nothing to worry too much about)
The marvelous things about (co)homology theories is that they are the same for every homotopic topological space, i.e. they are the same for space with can be continously deformed into each other.
Now, $\mathbb{R} \times (\mathbb{R}^2 - \{0\})$ is, since $\mathbb{R}$ can be deformation retracted to a point, homotopy equivalent to $\text{Pt} \times (\mathbb{R}^2 - \{0\}) = \mathbb{R}^2 -\{0\}$, which is in turn homotopy equivalent to the circle $S^1$.
On the contrary, $\mathbb{R}^3 - \{0\}$ is homotopy equivalent to the sphere $S^2$.
Of both these homotopy equvialences you may convince yourself by your intuition, but, as I was writing this, I had to admit that I cannot put this into words that transmit well between me and my readers without a blackboard and some time.
So, accepting Eilenberg-Steenrod, our question of whether we can or cannot lift a 1-form in the kernel of the derivative to be the image of a 0-form has reduced to the question whether the first cohomology of the circle or the sphere vanish.
Now, certainly all n-spheres are compact spaces, and certainly they have now boundary. Since we can describe them with polar coordinates locally, they are also manifolds. Now, for such compact orientable manifolds, there is Poincaré duality, which states that the $p$-th cohomology $H^p(\mathcal{M})$ is isomorphic to the $n-p$-th homology $H_{n-p}(\mathcal{M})$. But the ordinary homology of spheres is well understood! In fact, just by thinking with the Eilenberg-Steenrod axioms, you can show that, since every sphere $S^n$ is essentially made out of two disks $D^n$ glued together (the hemispheres), $H^n(S^n) = \mathbb{Z}$ and $H^0(S^n) = \mathbb{Z}$, but $H^p(S^n) = 0$ if $p \neq n \wedge p \neq 0$. The duality then yields directly that
$$ H_1(S^1) = \mathbb{Z} \wedge H_1(S^2) = 0 $$
Thus, for the actual 2-sphere $S^2$ , the kernel of the derivative is the image of the derivative, and every vector field on the sphere (and anything that is homotopy equivalent to it) whose curl vanishes is the exterior derivative of some scalar function. But for the circle $S^1$, there are fields which are in the kernel of the derivative but not its image, else the cohomology would be trivial.
Since the Aharonov-Bohm situation has a line singularity and is homotopic to the circle, the usual argument for "conservative forces" fails. But, for point singularities in 3D, we are homotopic to the sphere, where the argument goes through.