Avoid "broken pipe" errors from shell commands

When executing a shell command, Babushka sets up pipes for each of the
stdin, stdout, and stderr connected to the sub-process. If the process
decides it doesn't need any more data coming into its stdin and closes
it, Babushka should stop writing into it (which would cause a broken
pipe error).

The implementation is to catch such an error and close the pipe if that
happens. Babushka already won't write into the pipe if it's closed on
our end (the write end).