[bugfix] fix flush.go nil pointer panic (#6993)
[bugfix] fix flush.go nil pointer panic (#6993)

**What this PR does / why we need it**:
Fix a panic when reporting chunk statistics. The chunk would already be garbage-collected as it is marked as flushed before reporting its statistics. This fix it by first reporting its statistics and only then marking it as flushed.
 
Panic description:
```go
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x177d158]

goroutine 14455 [running]:
github.com/grafana/loki/pkg/chunkenc.(*MemChunk).Size(0xc00441c750?)
  /loki@v1.6.2-0.20220816085209-65ed7b60fbd4/pkg/chunkenc/memchunk.go:611 +0x18
github.com/grafana/loki/pkg/ingester.(*Ingester).reportFlushedChunkStatistics(0xc00087a000, 0xc00f8efe80, 0xc0519d0870, {0x36b7008, 0xc01a593860}, {0x36b7008, 0xc01a5938c0}, {0x307e2f9, 0x7})
  /loki@v1.6.2-0.20220816085209-65ed7b60fbd4/pkg/ingester/flush.go:395 +0x2f2
```
grafana/loki,grafana/loki,grafana/loki,grafana/loki,grafana/loki,grafana/loki