libtest: Only colorize output if stdout is a tty

Fixes #14570.
auto merge of #14571 : bnoordhuis/rust/libtest-check-isatty, r=alexcrichton

Fixes #14570.