Computing $\langle 0|S |0\rangle$ in $\phi^4$ theory $\newcommand{\bra}[1]{\langle #1|}$
$\newcommand{\ket}[1]{|#1\rangle}$
I have been reading David Tong's QFT notes. As part of an exercise, I am asked to examine $\bra{0} S \ket{0}$ to order $\lambda^2$ in $\phi^4$ theory, but I am unable to make sense of either the first or second order terms. I've written out the steps I took.
I begin with the Lagrangian density $$\mathcal{L} = \frac{1}{2} \left( \partial_\mu \phi \partial^\mu \phi - m^2 \phi^2 \right) - \frac{\lambda}{4!} \phi^4,$$ from which I get Hamiltonian density $$\mathcal{H} = \frac{1}{2} \left( \pi^2 + (\nabla \phi)^2 + m^2 \phi^2 \right) + \frac{\lambda}{4!} \phi^4.$$ From here I write the Hamiltonian as $H = H_0 + H_i$ for $H_0$ the Hamiltonian for the free theory, and $$H_i = \frac{\lambda}{4!} \int d^3 \vec{x} \; \phi(\vec{x})^4 .$$ Now I move to interaction picture, where the interaction Hamiltonian is given
$$H_I = e^{i t H_0} H_i e^{-i t H_0} = \frac{\lambda}{4!} \int d^3 \vec{x} \; \phi(\vec{x},t)^4. $$
Where $\phi(\vec{x},t)$ is in the Heisenberg picture for the free theory. Now we use Dyson's formula to get that
$$S = T \exp \left(-i \int_{\infty}^{\infty} H_I(t) dt \right) = T \exp \left( -i \frac{\lambda}{4!} \int d^4 x \; \phi(x)^4 \right).$$
Thus to second order in $\lambda$,
$$\bra{0} S \ket{0} = 1 - i \frac{\lambda}{4!} \int d^4 x \; \bra{0} \phi(x)^4 \ket{0} - \frac{\lambda^2}{2 (4!)^2} \int d^4 x d^4 y \; \bra{0} T \phi(x)^4 \phi(y)^4 \ket{0} + O(\lambda^3).$$
So, I must compute each of $\bra{0} \phi(x)^4 \ket{0}$ and $\bra{0} T \phi(x)^4 \phi(y)^4 \ket{0}$ then I can just integrate these to get my perturbation series.
For the first case, we expand $\phi(x)^4$, which is already time ordered, into a bunch of terms involving normal ordering and Feynman propagators. I think any terms involving normal ordering should get killed when we consider the product with $\bra{0}$ and $\ket{0}$, and so we should have $$\bra{0} \phi(x)^4 \ket{0} = \bra{0} 3 \Delta_F(x-x)^2 \ket{0} = 3 \Delta_F(0)^2,$$ but this troubles me. First of all, it is independent of $x$, which seems sensible, but this whatever value it takes when I integrate $\int d^4 x \bra{0} \phi(x)^4 \ket{0}$ I'm bound to get an infinite value unless $\Delta_F(0)$ vanishes.
So, is this true? I am told
$$\Delta_F(x-y) = \int \frac{d^4 k}{(2\pi)^4} \frac{i e^{i k (x-y)}}{k^2 - p^2 + i \epsilon}$$
Thus
$$\Delta_F(0) = \int \frac{d^4 k}{(2 \pi)^4} \frac{i}{k^2 - p^2 + i \epsilon}.$$
To do the $k^0$ integral, I only have to consider the pole at $-E_\vec{k} =-\sqrt{k^2 + m^2}$, which simplifies the integral to
$$
\Delta_F(0) = \int \frac{d^3 \vec{k}}{(2 \pi)^3} \frac{1}{2E_{\vec{k}}}\,,$$
but I'm pretty sure the above integral diverges. As $\vec{k}$ gets large the integrand goes as $1/k$, which is too slow of a decay for convergence.
So, what gives? Where have I screwed up?
I've thought about the second order term as well, but the issue I have there is more or less the same.
 A: 
So, what gives? Where have I screwed up?

You didn't screw up. As mentioned in the comments, the vacuum expectation value you are interested has a bunch of infinite terms.
In terms of Feynman diagrams these are just loop diagrams ("bubbles") with no external particles, and they diverge.
Basically, what happens in practice is that we are not interested only in $\langle S\rangle$, but we are interested in related things like $\langle S\phi_x\phi_y\rangle/\langle S\rangle$. Order by order we can gather up the bubbles and show they cancel between numerator and denominator. This gets rid of disconnected bubbles, but does not get rid of all the infinities. To address infinities in loop integration you introduce counter terms and this leads to things like "renormalization" of, e.g., the mass (e.g., the mass term in the Lagrangian turns out not to be the physical mass).
I actually found this easier to understand in finite-temperature field theory, where the vacuum bubble are related to the partition function. The book by Kapusta (Finite-Temperature Field Theory) might be helpful to you.
