Fix a couple of things:
- Don't call pthread_testcancel too often.
- Make sure pthread_join waits for thread to exit
- Don't deadlock for try_join.


git-svn-id: https://svn.code.sf.net/p/mingw-w64/code@6458 4407c894-4637-0410-b4f5-ada5f102cad1
Disable EBUSY for semaphore-destruction


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