Flush stdout after writing a line.