On non window machine prefer nanosleep over usleep.

Nanosleep allows us to handle EINTR signals properly unlike usleep. This could
increase the stability in our testing infrastructure.
Merge pull request #224 from robertmaynard/sleepfor_handles_eintr

On non window machine prefer nanosleep over usleep.