After all rows are written flush the contents to disk
This is needed for chunked exports with append mode, because otherwise the content
still stays in buffer till php ends, which would made the chunked export useless.