unix: fix build when !defined(PTHREAD_MUTEX_ERRORCHECK)

Ancient versions of glibc (<= 2.3.1) don't have error-checking mutexes.
Merge remote-tracking branch 'origin/v0.10'