Change err.errno === 47 into err.code === EEXIST because errno is not 47 anymore for EEXIST, it is 17 now, and that's not portable anyways