Writing into sstable component output stream should be done with care. In particular -- flushing can happen only once right before closing the stream. Flushing the stream in between several writes is not going to work, because file stream would step on unaligned IO and S3 upload stream would send completion message to the server and would lose any subsequent write.
Most of the file_writer users already obey that and flush the writer once right before closing it. The do_write_simple() is extra careful about exceptions handling, but it's an overkill (see first patch).
It's better to make file_writer API explicitly lack the ability to flush itself by flushing the stream when closing the writer.
Closes#13338
* github.com:scylladb/scylladb:
sstables: Move writer flush into close (and remove it)
sstables: Relax exception handling in do_write_simple