Calculating variance for a sequence of i.i.d. variables which seems non-partitionable 
Let $(Z_n : 1 \leq n < \infty )$ be a sequence of independent and identically distributed (i.i.d.) random variables with $$\mathbb{P}(Z_n=0)=q=1-p,\quad \mathbb{P}(Z_n=1)=p.$$ Let $A_i$ be the event $$\{Z_i=0\}\cap\{Z_{i-1}=1\}.$$  If $U_n$ is the number of times $A_i$ occurs for $2 \leq i \leq n$, prove $\mathbb{E}(U_n)=(n-1)pq$, and find the variance of $U_n$.

I was able to solve this question, only calculating the variance didn't work. I think it's best to use $$\mathrm{Var}(U_n)=\mathbb{E}(U_n^2)-\mathbb{E}(U_n)^2,$$ because the second expectation is already calculated. However, I have no idea how to calculate $\mathbb{E}(U_n^2)$. Can anyone provide some help? 
EDIT:
By the way, the variance should be $\mathrm{Var}(U_n)=(n-1)pq-(3n-5)(pq)^2$, so the second moment of $U_n$ should be $(n-1)pq+(n-3)(n-2)(pq)^2$. Still, I have no clue how to calculate this second moment. 
EDIT 2:
Using Dean's answer, I tried solving for the variance. We have a random sum for the amount of zeros in $\{2,3,\ldots,n\}$, which has a binomial distribution with parameters $n-1$ and $q$. Then we obtain in total $j$ zero's, which can be preceded by ones. The preceding elements follow a Bernoulli distribution with parameter $p$. Thus, we can set up the probability generating functions to obtain:
\begin{eqnarray}
G_{zero's}(s) & = & (p+qs)^{n-1}\\
G_{ones}(s) & = &q+ps\\
G_{U_n}(s) & = & G_{zero's}(G_{ones}(s))=(p+q(q+ps))^{n-1}\\
G_{U_n}'(s) & = & (n-1)(p+q(q+ps))^{n-2}pq\\
G_{U_n}''(s) & = & (n-1)(n-2)(p+q(q+ps))^{n-3}(pq)^2\\
\mathrm{Var}(U_n) & = & G_{U_n}''(1)+G_{U_n}'(1)-G_{U_n}'(1)^2\\
& = & (n-1)(n-2)(pq)^2+(n-1)pq-(n-1)^2(pq)^2\\
& = & (n-1)pq+(n-1)(n-2-n+1)(pq)^2\\
& = & (n-1)pq-(n-1)(pq)^2.
\end{eqnarray}
However, the answer for this question says that the variance should be $\mathrm{Var}(U_n)=(n-1)pq-(3n-5)(pq)^2$, and since this is an old Oxford examination question, it seems unlikely that their answer is wrong. Also, the probability generating function seems allright, since $G_{U_n}'(1)$ indeed yields $\mathbb{E}(X)$.
Any ideas on where I can have made a mistake? It seems also strange to me that we determine a random sum which can yield at most $n-1$ zero's, and then treat this like every one of these zeros can have a preceding one. For example, when all tosses yield a zero, we know for sure that $U_n=0$, while the above implies that we have $n-1$ Bernoulli trials, so quite likely $U_n\neq 0$. How to fix this?

A correct approach would be to use the "run test", which counts the number of runs in a two-state sequence as a test of the independence of the elements of the sequence. Use the "run test" pmf for the number of runs $R$, given $n$ and $p$. Each time a run of ones end, you have satisfied the condition $A$. The pmf for $U$ is found by considering that $R=U/2$. Alternatively you could use $E[R]$ and $V[R]$ directly to find $E[U]$ and $E[U]$.
Here is one site that explains how to derive the pmf for the run test:
https://onlinecourses.science.psu.edu/stat414/book/export/html/233
