fix spawn test that incorrectly used readandwrite() on a process
redirected to a file.