EDIT: To those of you uncomfortable with me proclaiming that \$R = 0\$ in the end, it is analogous to taking the resistance of air to be infinite. And if you are still uncomfortable, read "infinite" as "really really large", and "zero" as "really really small".
There is infinite current flowing through zero resistance, and this results in a finite energy being dissipated in the wire. To make sense of this, we need to do a bit of calculus. Suppose there is also a resistance \$R\$ in the circuit, which we shall set to zero at the end.
Let \$V_0 = q_0 / C_1\$. Doing the usual Laplace transform for circuits, the transformed current \$I(s)\$ is given by
$$
\begin{align}
\frac{V_0}{s}
&= I(s) \left[ R + \frac{1}{s C_1} + \frac{1}{s C_2} \right] \\
&= I(s) \left[ R + \frac{1}{s C} \right] \\
\end{align}
$$
where \$1/C = 1/C_1 + 1/C_2\$. Thus
$$
\begin{align}
I(s)
&= \frac{V_0 / s}{R + 1 / (s C)} \\
&= \frac{V_0 / R}{s + 1 / (R C)} \\
i(t) &= \frac{V_0}{R} \cdot \mathrm{e}^{-t / (R C)}.
\end{align}
$$
The instantaneous power dissipated is
$$
\begin{align}
P(t)
&= i(t)^2 \cdot R \\
&= \frac{{V_0}^2}{R} \cdot \mathrm{e}^{-2t / (R C)}
\end{align},
$$
and so the total energy dissipated is
$$
\int_0^\infty \frac{{V_0}^2}{R} \cdot \mathrm{e}^{-2t / (R C)} \,\mathrm{d}t
= \frac{1}{2} C {V_0}^2
= \frac{{q_0}^2 C_2}{2 C_1 (C_1 + C_2)}.
$$
Note that this is independent of \$R\$, and I would argue it even holds for \$R = 0\$.
Indeed setting \$R\$ to zero in the context of generalised functions, we have that
$$
\begin{align}
i(t) &= C V_0 \cdot \delta(t) \\
P(t) &= \frac{1}{2} C {V_0}^2 \cdot \delta(t),
\end{align}
$$
where \$\delta(t)\$ is the Dirac delta (or unit impulse) in time, which has dimensions \$1/\text{time}\$. Thus all of the energy is dissipated in the instant \$t = 0\$.