Rename flushAndWrite() to writeAndFlush()

- Related: #2066