console: don't use colored output if there's no TTY

This prevents ANSI escape codes and style tags showing up in
cron-jobs, pipes or redirects.

I used `posix_isatty()` to detect if we're on a terminal or not.