fix compilation on threaded perls