Disclaimer: Locally compact groups are absolutely not my field of expertise. I hope an expert can check my statements below, and perhaps add some details and references.
The Malcev–Iwasawa theorem implies that any connected, locally compact group $G$ satisfies:
$G$ has a maximal compact subgroup;
there exists $n\in\mathbb{N}$ such that for any maximal compact subgroup $K$ of $G$, the underlying space of $G$ is homeomorphic to $K\times\mathbb{R}^n$.
In particular, every maximal compact subgroup of a connected, locally compact group is itself connected.
References: The following references state the necessary results without proof.
Theorem 32.5 of Markus Stroppel's book "Locally compact groups".
The article "Compact subgroups of Lie groups and locally compact groups" (DOI: http://dx.doi.org/10.1090/S0002-9939-1994-1166357-9), published in the Proceedings of the American Mathematical Society, volume 120, number 2, in February 1994 (pages 623-634). See the statements of theorems A, B, and C in the introduction to this article. According to the discussion there, the theorems hold for connected, locally compact groups: they follow from the analogous results for Lie groups as soon as one knows that a connected, locally compact group is a projective limit of Lie groups.