Fix various compilation issues on threaded perls
Use perl's builtin reentrancy helpers
v0.011

          Fix various compilation issues on threaded perls