Will Jagy's comment hits the nail on the head. Your substitution is not injective. See the plot of $u(x)=\cos x+\sin x$ on $0\le x\le \dfrac\pi2$:

In order to use this substitution, you need to first split up the integral at $x=\dfrac\pi4$. You must be careful when reversing the substitution, however, because there are infinitely many $x$ that satisfy the equation for a given $u$:
$$u = \cos x + \sin x = \sqrt2\,\sin\left(x+\frac\pi4\right) \\
\implies x + \frac\pi4 = \color{red}{\pm} \arcsin\frac u{\sqrt2} + \color{red}{2n\pi} \\
\implies dx = \color{red}{\pm}\frac{du}{\sqrt{2-u^2}}$$
Note that you've also made a small mistake in computing and subsequently replacing $dx$ in the $u$-integral.
When solving for the limits in the $u$-integral, you need to choose the correct branch of $\arcsin$ depending on the domain of $x$.
- If $0\le x\le\dfrac\pi4$,
$$u=\sqrt2\sin\left(x+\frac\pi4\right) \implies x = -\frac\pi4 + \arcsin \frac u{\sqrt2}$$
- If $\dfrac\pi4\le x\le\dfrac\pi2$,
$$u=\sqrt2\sin\left(x+\frac\pi4\right) \implies x = \frac{3\pi}4 - \arcsin \frac u{\sqrt2}$$
Notice how $u\in[1,\sqrt2]$ in the first case and $u\in[\sqrt2,1]$ in the second (same interval, but reversed). $u$ is decreasing in the latter, and that's reflected in the sign of the respective $dx$ element. Upon applying the substitution, you would end up with
$$\begin{align*}
\int_0^\tfrac\pi2 \frac{dx}{\cos x+\sin x} &= \left\{\int_0^\tfrac\pi4 + \int_\tfrac\pi4^{\tfrac\pi2}\right\} \frac{dx}{\cos x+\sin x} \\
&= \int_1^{\sqrt2} \frac{du}{u\sqrt{2-u^2}} \color{red}{-} \int_{\sqrt2}^1 \frac{du}{u\sqrt{2-u^2}} \\
&= 2 \int_1^{\sqrt2} \frac{du}{u\sqrt{2-u^2}}
\end{align*}$$
On the other hand, we can avoid all of this confusion by instead replacing $u=x+\dfrac\pi4$ and recalling the primitive of $\csc u$ :
$$\begin{align*}
\int_0^\tfrac\pi2 \frac{dx}{\cos x+\sin x} &= \frac1{\sqrt2} \int_0^\tfrac\pi2 \csc\left(x+\frac\pi4\right) \, dx \\
&= \frac1{\sqrt2} \int_\tfrac\pi4^{\tfrac{3\pi}4} \csc u \, du\\
&= -\frac1{\sqrt2} \left(\ln\left|\csc\frac{3\pi}4+\cot\frac{3\pi}4\right| - \ln\left|\csc\frac\pi4+\cot\frac\pi4\right|\right) \\
&= \frac1{\sqrt2} \ln \frac{\sqrt2+1}{\sqrt2-1} \equiv \sqrt2 \operatorname{artanh}\frac1{\sqrt2}
\end{align*}$$