wait for pexpect child process to emit EOF