This doesn't work, because the fundamental lemma of calculus of variations
$$ \forall_{\varphi \in C_c^\infty(U)} \int_U v \varphi = 0 \quad \Rightarrow \quad v \equiv 0 $$
works only for open $U$.
I propose the following proof. Choose a $C^1$ function $\psi \colon \mathbb R \to \mathbb R$ such that
$$ |\psi(t)| \le |t| \text{ for } t \in \mathbb R, \quad \psi(t) = t \text{ for } |t| \ge 1, \quad \psi'(0) = 0; $$
then $|\psi'|$ is bounded by some constant $M>1$. Consider the composition $u_\varepsilon(x) = \varepsilon \cdot \psi(u(x)/\varepsilon)$ for $\varepsilon > 0$. By formal computation, its derivative is
$$ \nabla u_\varepsilon(x) = \psi'(u(x)/\varepsilon) \cdot \nabla u(x), $$
hence $|\nabla u_\varepsilon| \le M|\nabla u|$ pointwise. Approximating $u$ by smooth functions, one can show that $u_\varepsilon \in W^{1,p}$ and the above calculations hold in the weak sense (in general, this is true for compositions with suitable $C^1$ functions).
Now take the limit $\varepsilon \to 0$. It is easy to see that $u_\varepsilon \to u$ pointwise and this sequence is dominated by $|u|$ (in fact, $u_\varepsilon \to u$ in $L^p$). The derivative is also pointwise convergent:
$$ \nabla u_\varepsilon(x) \to V(x) := \begin{cases} \nabla u(x) & \text{if } u(x) \neq 0 \\ 0 & \text{if } u(x) = 0 \end{cases} $$
and this sequence is dominated by $M|\nabla u|$. For any test function $\varphi$, Lebesgue dominated convergence theorem shows that
$$ \int V \varphi \leftarrow \int \nabla u_\varepsilon \varphi = - \int u_\varepsilon \operatorname{div} \varphi \rightarrow - \int u \operatorname{div} \varphi = \int \nabla u \varphi. $$
Hence $\nabla u = V$ a.e. and $\nabla u = 0$ a.e. in $\{ u=0 \}$.