Flush all subprocess output before exit

Subprocesses write to stdout. They must flush their output before the
main process exits to avoid losing output or confusing the calling
program.
Merge branch 'flush_stdout' into 'master'

Flush stdout

As noted in email, it seems that failing to flush stdout in the sub-processes means that some output might go missing. I've observed this in practice with Syntastic in Vim. Here I flush both stdout and stderr before sending the message back to the main process that will allow it to continue. This makes the problem disappear for me.

It occurs to me that if sub-processes are producing output independently, there is also be a risk that they will badly interleave their output. I haven't looked into this - my primary concern is invocation for a single file at a time.

See merge request !7