fix tests compilation on MSVC

There are some changes needed to compile under MSVC and MinGW.
My fault, did not notice _getpid() :)

Will repush.