fix tests compilation on MSVC

There are some changes needed to compile under MSVC and MinGW.
sleep and getpid are missing under MSVC.