Fix build with MinGW.  Fixes #9301.