pthread.c: explicily cast thrd_t to pthread_t

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
pthread.c: add support for platforms without PTHREAD_MUTEX_TIMED_NP

Signed-off-by: Steven Noonan <steven@uplinklabs.net>