(__pthread_lock): Reset p_nextwaiting to NULL if it turned out that we