Don't set colors if not connected to a terminal

This is a bit of duplication but it prevents the early debug messages
from being in color when they shouldn't be. Oh well.