Only run fs.statSync once

This saves a call to `fs.statSync`.