Fix background color and use libc::isatty when TERM is not definied