Revert "Remove harmful attempts to be helpful in pthread_mutex functions."

This reverts commit 3ed9ec924a4176e9d722e670933cc7cd61bb54ae.