This is a B thread, so I don't want to divulge into the mathematics, but you can refer to Wald Chapter 8.
I'll talk a little more on this issue, even though I thought I said enough! Locally, ALL general relativity spacetimes reduce to the causality presented in special relativity, so the only place we can have closed causal loops is somewhere globally. If you follow standard general relativity, then I will assume you believe that we have a globally hyperbolic spacetime. Globally hyperbolic spacetimes are stably causal. Thus, if our spacetime is stably causal, we can't have closed causal loops.
Chapter 8 in Wald folks, he proves this all. I might need to refresh my memory, but I believe this is the gist of it.
(Globally hyperbolic is just a fancy term for a spacetime that has a Cauchy surface).