Add `spawn.sendEof` to close the stdin pipe

`spawn.sendEof` allows users to close child's process stdin stream
and let it know there are no more data coming.

This change enables testing of apps that are using inquirer,
as `inquirer.prompt()` calls `stdin.resume()` at some point,
which causes the app to block on input when the input stream is a pipe.