implement window resizing, + more tty fixes

previously stdout/stderr of a process spawned with a tty would be jumbled, as the same fd (the tty) was sent to the iodaemon linker, wherein it forked off two goroutines doing `io.Copy`, which led to randomness.

this fixes that, and also introduces window resizing support.