Work around buggy errno handling in cygwin.dll