Make it so fadvise works in the presence of ResetStatistics

ResetStatistics was resetting the number of bytes written, which was
then messing up which portion of the file we were flushing.

While we are here, make it so that encoder_->Clear() works properly with
partial writes at the beginning of the queue.  This wasn't being
triggered because we typically only write 1 chunk at a time.

Change-Id: Ief8518e13e7de1b6b27bc0ca968967643e3f48aa
Signed-off-by: Austin Schuh <austin.linux@gmail.com>
diff --git a/aos/events/logging/logfile_utils.h b/aos/events/logging/logfile_utils.h
index 50f6b40..0c0ef7f 100644
--- a/aos/events/logging/logfile_utils.h
+++ b/aos/events/logging/logfile_utils.h
@@ -212,6 +212,8 @@
   bool supports_odirect_ = true;
   int flags_ = 0;
 
+  size_t file_written_bytes_ = 0;
+
   aos::monotonic_clock::time_point last_flush_time_ =
       aos::monotonic_clock::min_time;
 };