Indeed, I believe it's impossible to statically prevent race conditions in a turing complete language. Data races can be prevented, but that's just a subset of all possible race conditions.
Same thing applies to the STM "subset" of Haskell -- conformance to which is statically verified by the type checker[1].
[1] There's no particular magic going on wrt. checking -- STM is a monad. It just happens to have "magic" runtime support.