Force STDOUT autoflush when reading STDIN

- otherwise the output from grep will show up before the output of the
  header line (because the header line's output is likely small and less
  than bufsiz, while grep's will likely be larger)