Fix bug with flush timer

Signed-off-by: Ricardo Leitão <rleitao@lqd.io>