Write subprocess output to a temporary file before reading it into memory.
Should get rid of broken pipe error on FreeBSD (hopefully).