very, very partial backport of 2f795d8f to maint/v0.21 branch without this include, O_RDWR and O_CREAT are undeclared when building tests/path/win32.c with mingw