Add missing defines ...


git-svn-id: https://svn.code.sf.net/p/mingw-w64/code@6480 4407c894-4637-0410-b4f5-ada5f102cad1
Add some code to clarify state of busy and avoid possible underflow of it.


git-svn-id: https://svn.code.sf.net/p/mingw-w64/code@6481 4407c894-4637-0410-b4f5-ada5f102cad1
Destroy mutex in locked-state ... this avoids races on destruction.
Additionally make sure that internal global_lock is released at very end


git-svn-id: https://svn.code.sf.net/p/mingw-w64/code@6482 4407c894-4637-0410-b4f5-ada5f102cad1