Fix for #1223

This is still broke.
This doesn't look right.  Variable `stat` is local to the `forEach()` callback which is (still) created with a call to `fs.statSync()`.