We must view $\omega$ as a complex variable and the integrand as a meromorphic function of a complex variable, with simple poles at $\omega_{\pm} = \pm cK$.
\begin{equation}
\int_{-\infty}^{\infty}\frac{c^2e^{it\omega}}{(\omega - cK)(\omega + cK)}d\omega
\end{equation}
There are two distinct parts to the integral along $\mathbb{R}$:
- the principal value ($\mathsf{PV}$) of the integral is what we get when we integrate along the real line, except for the radius-$\epsilon$ semicircles, and then let $\epsilon$ shrink to 0;
- the numbers we pick up from integrating along the radius-$\epsilon$ semicircles and letting $\epsilon$ shrink to 0.
\begin{equation}
\begin{split}
&~\oint_{\gamma}\frac{c^2e^{itz}}{(z - cK)(z + cK)}dz\\
=&~ \textsf{PV}\int_{-\infty}^{\infty}\frac{c^2e^{it\omega}}{(\omega - cK)(\omega + cK)}d\omega \pm i\pi\frac{e^{itcK}}{2cK} \pm i\pi\frac{e^{-itcK}}{-2cK} + 0,
\end{split}
\end{equation}
where $\gamma$ is the limit curve of curves that that lie along the real line from $-R$ to $R$ but make small semicircles above or below the singularities, and then go along a large arc from $R$ back to $-R$. Jordan's Lemma ensures that the limit of the integral along the large arc is 0. The sign of $t$ determines whether one chooses an arc in the upper half-plane or the lower half-plane.
Each sign attached to a latter term depends on whether the semicircle went into the upper half-plane (clockwise around singularity) or into the lower half-plane (counter-clockwise around the singularity).
Moving the line away from the real line gives another expression for the integral and works because integrating around a box containing both $\mathbb{R}$ (deformed to avoid singularities) and $\mathbb{R}\pm i\epsilon$ (in the opposite direction) is 0.
Let $\Gamma$ be a box with two indentations that goes
- from $-R$ to $R$ along the real line,
- but avoids the singularities via semicircles,
- goes from $R$ to $R \pm i\epsilon$,
- goes from $R \pm i\epsilon$ to $-R + \pm i\epsilon$,
- and then from $-R \pm i\epsilon$ to $-R$.
The integrand has no singularities inside this box, so integrating around it yields 0 by Cauchy's Integral Theorem. As $R\to\infty$, the integrals along vertical edges drop to 0, so the $\mathsf{PV}$ of the integral along the real line (from $-\infty$ to $\infty$) plus the integral along $\mathbb{R} + i\epsilon$ (from $\infty + i\epsilon$ to $-\infty + i\epsilon$) is 0.
This means that the integral along $\mathbb{R} \pm i\epsilon$ is equal to the $\mathsf{PV}$ plus the terms picked up from the semicircles over or under the singularities at $\omega_{\pm} = \pm cK$:
\begin{equation}
\begin{split}
&~\int_{-\infty\pm i\epsilon}^{\infty \pm i\epsilon}\frac{c^2 e^{itz}}{(z - cK)(z+cK)}dz\\
=&~\textsf{PV}\int_{-\infty}^{\infty}\frac{c^2e^{it\omega}}{(\omega - cK)(\omega + cK)}d\omega \pm i\pi\frac{e^{itcK}}{2cK} \pm i\pi\frac{e^{-itcK}}{-2cK}
\end{split}
\end{equation}
This might also be written as
\begin{equation}
\begin{split}
&~\int_{-\infty}^{\infty}\frac{c^2 e^{it(\omega \pm i\epsilon)}}{(\omega \pm i\epsilon - cK)(\omega \pm i\epsilon + cK)}d\omega\\
=&~\textsf{PV}\int_{-\infty}^{\infty}\frac{c^2e^{it\omega}}{(\omega - cK)(\omega + cK)}d\omega \pm i\pi\frac{e^{itcK}}{2cK} \pm i\pi\frac{e^{-itcK}}{-2cK}
\end{split}
\end{equation}
From what I see in a textbook, some authors note that as $\epsilon\to 0$, $f(\omega \pm i\epsilon)\to f(\omega)$ for $f$ continuous at $\omega$. Then they cheat by dropping the $\pm i\epsilon$ in the numerator. In our case, we get the incorrect expression
\begin{equation}
\int_{-\infty}^{\infty}\frac{c^2 e^{it\omega}}{(\omega \pm i\epsilon - cK)(\omega \pm i\epsilon + cK)}d\omega
\end{equation}
because $\pm i\epsilon$ has been removed from the argument of the exponential. This notation gives the reader a warning that there are singularities encountered along $\mathbb{R}$, but the OP's experience shows that it must be used with care or not at all.
For more examples with diagrams, see Principal Value of an Integral in Mathematical Physics by Sadri Hassani.