[mingw-warning-fix][array-bounds]

MinGW thinks it's possible to exceed the array bounds on line 898; it's not clear to me whether or not this is possible after looking at the code. This addition shouldn't hurt anything anyway.
[clang-warning-fix][tmpnam-dangerous]

Clang 3.5 reports using tmpnam() as dangerous and to use mkstemp() instead. I believe this change will produce the same behavior as the original code but not 100% sure as I'm not very familiar with POSIX-only functions.