Yes, you are allowed to use any path in the complex plane but it has to contain the imaginary axis. For example you could use a semicircle with it's diameter on the imaginary axis and then making the radius go to infinity, but you have to be careful with the sign of $x$ to assure convergence.
If you do a simple change of variables $\omega \to i\omega$ you'll get a simpler integral (it's just the Fourier transform of $1$) to do and this time you have to have a path that contains the real axis, like a semicircle. In this case it'll be easier to change the path whether $x$ is positive or negative. The path rotated since by doing the change of variable $\omega\to i\omega$ you're rotating by $\pi/2$ in the complex plane so essentially you're doing the same exact thing.