only use colors when attached to a terminal

If STDOUT is not hooked up to a terminal, automatically disable the
colors by setting the appropriate environment variable.