Alternative fix for https://github.com/joyent/node/issues/8859

(there's an alternate proposed fix here:
https://github.com/zetxx/node/commit/c691bf340effde7974e25e3be2aa409bf14
c2012)