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

This reverts commit 3ed9ec924a4176e9d722e670933cc7cd61bb54ae.
Merge pull request #1 from Mahdi-Rom/kk-4.4

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