The correct choice of the contour is the essence of the entire calculation. In vacuum QFT you need the time-oredered propagator (which in this case is the same as the Feynman propagator). A much better derivation than the handwaving one given in Peskin&Schroeder is to simply evaluate the expectation value, defining the free KG propagator, using the mode decomposition of the field operator:
$$\mathrm{i} \Delta(x)=\langle \Omega|\mathcal{T} \hat{\phi}(x) \hat{\phi}(0) \omega \rangle.$$
The mode decomposition is
$$\hat{\phi}(x)=\int_{\mathbb{R}^3} \mathrm{d}^3 \vec{p} \frac{1}{\sqrt{(2 \pi)^3 2 \omega_{\vec{p}}}} \left [\hat{a}(\vec{p}) \exp(-\mathrm{i} p \cdot x)+\hat{a}^{\dagger}(\vec{p}) \exp(+\mathrm{i} p \cdot x) \right]_{p^0=\omega_{\vec{p}}},$$
where
$$\omega_{\vec{p}}=+\sqrt{\vec{p}^2+m^2}.$$
Using this convention the commutation relations for the annihilation and creation operators read
$$[\hat{a}(\vec{p}),\hat{a}^{\dagger}(\vec{p}')]=\delta^{(3)}(\vec{p}-\vec{p}').$$
Now first evaluate the Mills representation Wightman function ("fixed order correlation function")
$$\mathrm{i} \Delta^{21}(x)=\langle \hat{\phi}(x) \hat{\phi}(0),$$
i.e.,
$$\mathrm{i} \Delta_{M}^{21}(t,\vec{p})=\int_{\mathbb{R}^3} \langle \hat{\phi}(x) \hat{\phi}(0) \rangle \exp(-\mathrm{i} \vec{x} \cdot \vec{p}).$$
Then you get the Mills representation of the time-ordered function as
$$\Delta_{M}(t,\vec{p})=\Theta(t) \Delta_{M}^{21}(t,\vec{p}) + \Theta(-t) \Delta_{M}^{21}(-t ,\vec{p}).$$
Then to finally get the momentum-space Green function do the final Fourier transformation with respect to ##t##. The final result, of course should be
$$\tilde{\Delta}(p)=\frac{1}{p^2-m^2+\mathrm{i} 0^+}.$$