helper: call fflush() to get the right size from fstat()