Fixed broken timed wait for thread and mutex in WaitForSingleObject

* Remove broken ```#ifdef __linux__``` 
* Replaced ```gettimeofday``` with posix ```clock_gettime```