gunix{input,output}stream: Don't poll() unnecessarily
@walters
Submitted by Colin Walters Link to original bug (#742547)
Description
Regular files (not pipes or sockets), will always poll() as readable/writable. It's pointless to call poll() on them.
Similarly, if we're doing a synchronous non-cancellable read/write, there's no reason to block in poll() on the fd - just block in read()/write().
I'm writing this patch mainly to make strace on ostree prettier.
Implementation note: the cancellation check is hoisted to the top of the loop, so we still support cancellation for regular files.