Implemented fallback functions for pthread_timedjoin_np and
pthread_mutex_timedlock functions for systems without PTHREAD_GNU_EXT
Now returning WAIT_TIMEOUT if the operation timed out.
Always including <errno.h> now.
Returing WAIT_TIMEOUT for MUTEX objects now too.
Added missing variable declaration.
Merge pull request #1556 from akallabeth/WaitForSingleObject_portable_thread_timeout

Wait for single object portable thread and mutex timeout