[WIP] Refactor to use dispatch_io for tasks, and wait for EOF

Hopefully resolves #151, #139, and #135.

/cc @joshaber @keithduncan
We should use `pipe(2)` ourselves so that the file descriptors aren’t tied to the lifetime of this `NSPipe`