add missing `include <sys/stat.h>` on non-Windows platforms