Consider for example $f(x) = -\frac{2}{\pi}x + 8\sin(\frac{x}{8})$ and $g(x) = -\frac{2}{\pi} + \cos(\frac{x}{8}).$
The Fourier series of $f(x)$ with a period of $4\pi$ is not odd, nor even, but it is the indefinite integral of $g(x)$ and the Fourier series of $g(x)$ with period $4\pi$ defined as $\mathbb{R} \to \mathbb{R}$ is even. But how is that possible? The integral of an even function should be odd.
Before we address your issue, let's take a closer look at two statements you make:
This is only true for the case where the offset is zero. To take a simple example, the constant function 1 is clearly even, but its integral
$$\int_0^x 1 \;\mathrm dx = x + C$$ is odd only if $C=0$.
An "indefinite integral of $g$" is just a function $F(x)$ such that $\int_a^b f(x) = F(b) - F(a)$. As usual, the family of such functions includes all those that differ by a constant. One of them in particular will be odd. However, the Fourier series actually tells you that it is the particular, definite integral that has a lower limit of zero.
Now, in your case, $f(x) = -\frac{2}{\pi}x + 8\sin(\frac{x}{8})$ is odd, and
$$\int_0^{x} g(t) \mathrm dt = \int_0^t \frac2\pi + \cos(t/8)\mathrm dt = \frac2\pi x + 8 \sin(x/8) = f(x)$$ which is odd as desired --- but note that this integral is not indefinite.