Windows port: fix threading crash in creating llvm module and memory manager 

I still don't understand what's going on here, but I'm submitting this anyway so that all our Windows fixes exist as pull requests, and maybe someone can give a hint about what might be causing this.