Moved scope exit down as this fails to compile on windows.

Moved scope exit down as this fails to compile on windows.
Exactly the same thing that would of happened in the original case, I have no idea nor can I test it as this won't currently link with the llvm libs.