MinGW: a helper function that translates Win32 API error codes