Fixed the mismatched thread id between unit test and header.

Now links in libgomp if and only if building with gcc