Fixed broken timed wait for thread and mutex objects in WaitForSingleObject.
Using CLOCK_MONOTONIC instead of CLOCK_REALTIME now.
Fixed timeout comparison for systems missing GNU posix extensions.
Added missing C definition for HAVE_PTHREAD_GNU_EXT.
Extended test, now also checks, if lock / unlock is working.
Added unit tests for thread and mutex.
Fixed includes and test function naming.
Merge pull request #1592 from akallabeth/sync_timed_fixes

Fixed broken timed wait for thread and mutex in WaitForSingleObject