converted from git-svn
Prepare new release: fix some winpthreads deadlock and add workarounds for C++ linkage bug in intrin.h

git-svn-id: svn+ssh://svn.code.sf.net/p/mingw-w64/code/tags/v3.1.0@6434 4407c894-4637-0410-b4f5-ada5f102cad1