Integer-valuedness of the winding number:
I assume that the function $f$ has an isolated root at the origin and I integrate along a circle centered at the origin, $x+iy=\varepsilon\cos 2\pi t+i\varepsilon\sin 2\pi t$. The radius $\varepsilon$ is small enough that no other root is inside the circle, and moreover $f(t)$ does not vanish on the circle.
I decompose $f(t)$ on the circle into modulus and phase,
$$f(t)=|f(t)|e^{i\phi_0}e^{i\phi(t)},\;\;|f(t)|>0,\;\;f(0)=f(1).$$
I define $z(t)\equiv-i\ln e^{i\phi(t)}\in(-\pi,\pi]$. The logarithm has a branch cut on the imaginary real axis. The $t$-independent offset $\phi_0$ is chosen such that $z(0)=0=z(1)$, in order to avoid the branch cut at the initial and final times.
We wish to show that the integral
$$I=-i\int_0^1 \frac{d\ln f(t)}{dt}\,dt=-i\int_0^1 \frac{d\ln |f(t)|}{dt}\,dt+\int_0^1 \frac{dz(t)}{dt}\,dt$$
is an integer multiple of $2\pi$.
The modulus $|f(t)|$ does not cross the branch cut of the logarithm, hence
$$\int_0^1 \frac{d\ln |f(t)|}{dt}\,dt=\ln|f(1)|-\ln|f(0)|=0.$$
The function $z(t)$ is a piecewise continuous function, consisting of $N$ continuous segments $z_1(t),z_2(t),\ldots z_N(t)$, connected by $\pm 2\pi$ jumps at each $t=t_1,t_2,\ldots t_{N-1}$ where the branch cut of the logarithm is crossed:
$$z_p(t_{p})-z_{p+1}(t_p)=\sigma_p 2\pi,\;\;p=1,\ldots N-1,\;\;\sigma_p\in\{+1,-1\}.$$
We define $t_0=0$, $t_N=1$, hence $z(t_0)=0=z(t_N)$. The integral then evaluates to
$$\int_0^1 \frac{dz(t)}{dt}\,dt=\sum_{p=1}^N \int_{t_{p-1}}^{t_p}\frac{dz_p(t)}{dt}\,dt=\sum_{p=1}^N \bigl(z_p(t_p)-z_p(t_{p-1})\bigr)=\sum_{p=1}^{N-1}\sigma_p 2\pi.$$
The net sum of the $\pm 2\pi$ jumps is the winding number $W=\sum_{p=1}^{N-1}\sigma_p$, which indeed is an integer.
Comment: I did not use analyticity of $f$ in the complex plane, the winding number $W$ is an integer for any continuous function which does not vanish on the integration contour. The connection with the multiplicity of the root inside the contour requires analyticity, so that near a root $f\propto(x+iy)^W$.
Example:
In these plots I compare $z(t)$ for the two functions mentioned by the OP, $f_1=x+iy$ (left plot) and $f_2=x+iy^2$ (right plot). Both have an isolated root at the origin, but only $f_1$ is analytic. The first function has one $2\pi$ jump in $z(t)$, winding number 1, while the second function has no jump at all, winding number 0.