Don't output ANSI escape codes when output is not a tty

Signed-off-by: Maxime Petazzoni <max@signalfuse.com>