Consider the positively-oriented contour $C$ that spans the real axis from $-R$ to $R$ and then around the semicircle $Re^{i\theta}$ for $0\le \theta\le \pi$. Let
$f(x) := \frac{e^{-ipx/h}}{x^2+a^2} = \frac{e^{-ipx/h}}{(x+ia)(x-ia)}$
Now, we have (if $z_n$ are the poles of $f$ in $C$)
$\oint_C f(z)\, dz = \int_{-R}^R f(z)\, dz + \oint_{\text Arc} f(z)\, dz = 2\pi i \sum \operatorname*{Res}_{z = z_n} f(z)$
Letting $R \to \infty$, we see, for $p/h < 0$
$\int_{\text Arc}\frac{e^{-ipx/h}}{x^2+a^2}\,dz = \int_0^\pi \frac{e^{-ipRe^{i z}/h}}{(Re^{i z})^2+a^2}\,dz = 0$
$\oint_C f(z)\, dz = \int_{-\infty}^\infty f(z)\, dz$
so, because $ia$ lies in $C$ (and is the only pole in $C$)
$ z_0 = \operatorname*{Res}_{z = ia} f(z) = \lim_{z\to ia}(z-ia)f(z) = \frac{e^{-ip(i a)/h}}{2ia} = \frac{e^{-pa/h}}{2ia} $
so
$\int_{-\infty}^\infty f(z)\, dz = 2\pi i z_0 = 2\pi i\frac{e^{-pa/h}}{2ia} = \frac{\pi e^{-pa/h}}{a}$
for $p/h < 0$
Considering the new contour $\Gamma$ which is the same as $C$ except that it traverses $Re^{i\theta}$ for $\pi\le \theta\le 2\pi$, we see that
$\int_{\text Arc}\frac{e^{-ipx/h}}{x^2+a^2}\,dz = \int_0^\pi \frac{e^{ipRe^{i z}/h}}{(Re^{i z})^2+a^2}\,dz = 0$
when $p/h > 0$ and $R \to \infty$. Using the method above, we now have
$\int_{-\infty}^\infty f(z)\, dz = 2\pi i z_0 = 2\pi i\frac{e^{-pa/h}}{2ia} = \frac{\pi e^{pa/h}}{a}$
for $p/h > 0$
Putting our results together, we obtain the complete answer
$\int_{-\infty}^\infty f(z)\, dx = \frac{\pi e^{\left|\frac{p}{h}\right|a}}{a}$