Let G be a locally compact abelian group and suppose that for any non-trivial closed subgroup H of G, H is open. It also makes sense to suppose that G is non-discrete (since in that case this condition obviously holds). By Pontryagin Duality, every proper closed subgroup of $\widehat{G}$ is compact, so G is totally disconnected (see https://mathoverflow.net/questions/302554/what-are-the-lca-groups-that-are-the-pontryagin-dual-of-a-locally-profinite-abel).
G is also torsion-free, since any finite subgroup will have to be trivial (otherwise it would be open, which would in turn make G discrete).
If we suppose that G is compact, it's not hard to see that it is isomorphic to the p-adic integers for some prime p: Indeed, its dual is going to be a discrete torsion group (since G is profinite in this case) and also divisible (since G is torsion-free), therefore $\widehat{G}$ is isomorphic to a direct sum of various Prufer p-groups. But this direct sum can only have one component, since any proper closed subgroup has to be compact (and therefore finite, since $\widehat{G}$ is discrete). So $\widehat{G} \cong \mathbb{Z}(p^{\infty})$ for some prime p, which implies $G \cong \mathbb{Z}_p$.
What about the general abelian locally compact case? The p-adic numbers will also obey this property, but I don't know if they are the only ones.
I think this improved idea from comments works and shows that $G$ is isomorphic as a topological group either to some $\mathbb Z_p$ or to some $\mathbb Q_p$. But please check the details:
For any non-trivial element $x \in G$, $C_x :=$ the closure of the subgroup generated by $x$, is isomorphic and homeomorphic to $\mathbb Z_p$ for some $p$, which a priori might depend on $x$. But for any two such elements $x,y$, $C_x \cap C_y$ is open by assumption and hence contains open subgroups whose index is (nothing but) a power of $p$, which means it has to be "the same $p$" for $x$ and $y$, i.e. for all $x$. That gives the whole group $G$ a well-defined structure of $\mathbb Z_p$-module.
Refining the argument shows that again for any pair of nontrivial $x,y$, we have $p^m \mathbb Z_p \cdot x = p^n \mathbb Z_p \cdot y$ for certain natural $m,n$, and by dividing out the lower power, we get either $x \in p^r \mathbb Z_p \cdot y$ for some $r \in \{0,1,... \}$, or the analogous inclusion with $x,y$ flipped.
Case 1: There is $x \in G$ such that $x \notin p\mathbb Z_p \cdot y$ for any $y \in G$. Then by the above, mapping $x \mapsto 1$ gives a topological isomorphism of $G$ onto $\mathbb Z_p$.
Case 2: There is no $x$ as in case $1$. That means for any nontrivial $x$, there is a sequence $x_0 := x$, $x_1, x_2, ...$ of elements of $G$ such that $x_n = p \cdot x_{n+1}$. By the above argument, any $y \in G$ is contained in some $C_{x_n}$, and hence the map sending $x_n \mapsto p^{-n}$ induces a topological isomorphism $G \simeq \mathbb Q_p$.