Track bytes written when flushing