I see that a similar report was already closed as "won't fix". Would you consider accepting a patch to fix that? If so, please see the attached.
By the way, it is not feasible to expect that MinGW reuses mkstemp from MSYS, since MSYS is actually a fork of Cygwin, and thus comes with a completely different libc. MinGW simply reuses the libc which comes with MS-Windows.