Flush stdout after writing