Add checking whether stdout is a tty on Rust

Code uses libc function isatty()