No.
A totally disconnected space is $T_1$ (thx to Eric Wofsey's comment) (components, and thus points, are closed) and in a topological group this implies $T_2$ (and Tychonoff)
A (locally) compact countable Hausdorff space has an isolated point (by Baire's theorem) and as a topological group topology is homogeneous, all points are then isolated, so the group is discrete, and can only be finite.
To not let the comment by Idéophage go to waste, I'll add my own write-up:
Let $X_n = \{1,2,3,\ldots, n\}$ for all $n \in \Bbb N$ in the discrete topology.
The connecting morphisms $f_n: X_n \to X_{n-1}$ ($n \ge 2$) are
$$f_n(i) = \begin{cases} i & i < n \\ n-1 & i=n\end{cases}$$
Now some inverse limits 101:
The (inverse) limit $X_\infty$ consists of all "connected" sequences in $P:= \prod_{n \in \Bbb N} X_n$, i.e.
$$X_\infty = \{ (x_n)_n \mid \forall n: x_n \le n \text{ and } f_n(x_n)=x_{n-1}\}$$
which gets the subspace topology from the product topology on $P$ (and as $P$ is compact, Hausdorff and zero-dimensional, and $X_\infty$ is a closed subset of it, it has those same properties too).
There are just two types of points in $X_\infty$: either we have some $n$ so that $x_n =n$ and $x_{n+1} = n$ (that $n$ is unique and we'll have $x_k=n$ for all $k > n$ onwards, a "stagnant" point, which I will denote by $\mathbf{n} \in X_\infty$) or the point $x_n=n$ for all $n$ which I will denote by $\mathbf{\infty} \in X_\infty$. There are no other points as when we have $x \in X_\infty$ and $x_m < m$ for some $m$ then all $k <m$ the value is determined by the linkedness condition and for all $k>m$ too as a point $<m$ in $X_m$ only has one pre-image under the connecting map. So either we stagnate at a value or we keep increasing.
In terms of open sets, define $U(k,l) := \{x \in X_\infty\mid x_k =l\}$ for $k \in \Bbb N$ and $l \le k$ which are open (as $\pi_k^{-1}[\{l\}] \cap X_\infty$) in $X_\infty$ and by the previous considerations $$\{\mathbf{n}\} = U(n,n)\cap U(n+1,n)$$ so these are isolated points in $X_\infty$ and $U(n,n)$ is a neighbourhood of $\mathbf{\infty}$ that contains $\{\mathbf{k}\mid k \ge n\}$. It's now quite clear that $X_\infty \simeq \Bbb{N} \cup \{\infty\}$ (a convergent sequence, aka as the one-point compactifcation of $\Bbb N$ or $\omega+1$ as an ordinal space).
Best Answer
As Kevin Carlson explained in a comment, the answer is Yes.
More precisely, say that a space is compact if it is quasi-compact and Hausdorff. Then the Stacks Project text can be amended as follows:
Lemma. A limit of profinite spaces is profinite.
Proof. Let us use the characterization of profinite spaces in Lemma 5.22.2. By Lemma 5.14.1 the limit exists. By Theorem 5.14.4 the limit is compact. A limit of totally disconnected spaces is totally disconnected (details omitted). This finishes the proof.
The key point is that the equalizer of a double arrow $X\rightrightarrows Y$ is closed if $Y$ is Hausdorff (because it is the inverse image of the diagonal under the obvious map $X\to Y\times Y$, and the diagonal is closed since $Y$ is Hausdorff).
(I confess with shame that, when I wrote the question, I thought that equalizers were always closed. I'm sure I knew that this was not so when I leaned general topology, but I forgot it. I know it's silly...)