Update the handling of colour output for more use-cases.

Disable colours when stdout is not a terminal by default.

Add an option to enable colours when stdout is not a terminal.

Fixes: https://bugs.debian.org/742207