[pthread] Perform init_routine execution outside of the mutex
[pthread] Perform init_routine execution outside of the mutex

The mutex is common across all the threads. It needn't be held across
the init_routine() call as long as the 'once' behaviour is guaranteed

Saw a deadlock case, where init_routine of one thread was waiting for
the completion of init_routine in another thread.

t2: wait for command
t1: pthread_once:
         lock once_mux
         init_routine:
               inform thread t2
               wait for signal from t2
t2: received command
         pthread_once
             lock once_mux (already held by t1)
---- Deadlock ----

MIhanguangyi/esp-idf,www220/esp-idf,shukyisme/esp-idf-kwik,shukyisme/esp-idf-kwik,nineisk/esp-idf,armada-ai/esp-idf,empoweredhomes/esp-idf,shukyisme/esp-idf-kwik,mashaoze/esp-idf,shukyisme/esp-idf-kwik,armada-ai/esp-idf,nineisk/esp-idf,mashaoze/esp-idf,Hermiedapwdrman/esp-idf,MIhanguangyi/esp-idf,www220/esp-idf,MIhanguangyi/esp-idf,mashaoze/esp-idf,espressif/esp-idf,armada-ai/esp-idf,Hermiedapwdrman/esp-idf,mashaoze/esp-idf,MIhanguangyi/esp-idf,www220/esp-idf,mashaoze/esp-idf,espressif/esp-idf,espressif/esp-idf,shukyisme/esp-idf-kwik,armada-ai/esp-idf,Hermiedapwdrman/esp-idf,Hermiedapwdrman/esp-idf,MIhanguangyi/esp-idf,empoweredhomes/esp-idf,www220/esp-idf,nineisk/esp-idf,espressif/esp-idf,nineisk/esp-idf,empoweredhomes/esp-idf,Hermiedapwdrman/esp-idf,www220/esp-idf,empoweredhomes/esp-idf,empoweredhomes/esp-idf