There are three ways to fix this.
Perhaps the easiest and most direct one is to use a definite integral from $0$ to $y$ instead of the indefinite integral, then relabel $y$ to $x$.
Alternatively, if you want to stick with the indefinite integral: As pointed out in a comment, each of the integrations has its own integration constant $K_n$. Let $a_N=\int\sum_{n=0}^N(-1)^nx^{2n}$ be the partial sums of the original series, $b_N=\sum_{n=0}^N(-1)^n\frac{(-1)^nx^{2n+1}}{2n+1}$ the partial sums of the integrated series and $c_N=\sum_{n=0}^NK_n$ the partial sums of the integration constants. Then $a_N=b_N+c_N$, so $c_N=a_N-b_N$. Both $a_N$ and $b_N$ converge for $x\in(-1,1)$; hence $c_N$ converges. Denote its limit by $C$.
Or, think about what the indefinite integral actually means. It represents a class of functions that are antiderivatives of the function being integrated and differ by an additive constant. When you swap summation and indefinite integration, you're using the fact that summing any sequence of representatives of the infinitely many classes of antiderivatives on the right-hand side will yield an antiderivative of the integrand on the left-hand side, as long as you choose them so that the sum converges at all. So if you properly formulate a theorem that allows you to swap summation and indefinite integration, it would already be part of that theorem that a single additive constant appears on either side of the equation.
\leftand\right. – joriki Dec 15 '19 at 08:31