Make FileDescriptor.sync() work on ttys

fsync on Linux fails on tty file descriptors. This change
adds the capability to make sure all data was written to the
terminal device descriptor to java.io.FileDescriptor.sync()
implementation.

Also fixed the return value from Posix_isatty. isatty
returns 1 if an fd is a tty and 0 otherwise.

Change-Id: I6cc65db83f523b4c31b67b48d7534e18af0989e8
5 files changed