Update has-color.js

protect isTTY call when process.stdout == undefined