use PTHREAD_MUTEX_RECURSIVE_NP when available and PTHREAD_MUTEX_RECURSIVE is missing