[Bug 3598300]: unix: tcl.h does not include sys/stat.h.
(with an exception for OSX, for now)
... and fix cygwin build
Proposed solution for Bug 3598300 on MacOSX
fix Bug 3598300 on MacOSX too
merge main 8.5 branch