isatty and ttyname fixes

 * moved std stream isTerminal property to object so all streams can see

Currently, `isatty(open('/dev/stdin'))` returns false as the isTerminal property is only set on the global standard stream instances (fd 1, 2 and 3).

 * made ttyname use isatty to check if fd is tty

`ttyname_r` was using different conditionals than `isatty` to determine if the file descriptor belonged to a tty.

 * hardcoded /dev/tty as tty name is ttyname_r

the tty name isn't necessarily the stream's path, but the path of the node it eventually resolves to. I'm a bit fuzzy here, but I believe /dev/stdin normally links to /proc/self/fd/0 which in turn links to a TTY device of sorts. For right now I've hardcoded it to simply return `/dev/tty` which is the only available tty anyways.

 * fixed and changed isatty and ttyname tests to run natively

I've changed the tests to do some more meaningful checks, and similar to some of the other pr's, I dropped the JS postrun and output files so that the tests can be compiled and ran natively.