Detect vendor versions of GNU Compilers

Cray and other HPC vendors provide patched versions of the GNU compilers
with modified version strings.  Use re.search instead of re.match in the
version detection scripts to account for modified version strings.

Ref: https://github.com/numpy/numpy/issues/4259
ENH: remove insecure mktemp use

mktemp only returns a filename, a malicous user could replace it before
it gets used.
Merge pull request #4262 from juliantaylor/mktemp-remove

remove insecure mktemp usage
Merge pull request #4261 from ahmadia/allow_vendor_compiler_versions

BUG: Detect vendor versions of GNU Compilers