Given a positive smooth function $b:\mathbb{R}^{N+M}\to \mathbb{R}$ which vanishes exactly outisde of some $U\times\mathbb{R}^M$ ($U\subset \mathbb{R}^N$ open), is there another positive smooth function $c:\mathbb{R}^{N+M}\to \mathbb{R}$ so that

 1. $cb$ is constant in the $\mathbb{R}^M$ direction (i.e. factors over the projection $\mathbb{R}^{N+M}\to \mathbb{R}^N$)
 2. $cb$ vanishes exactly outside of $U\times\mathbb{R}^N$

My suspicion is that it should work, but my analysis skills are too lacking to proof it.
So far I had the following construction in mind:

Let $$\mu_k(n)=\exp\left(-\int_{||m||\leq k}\frac{1}{b(n,m)}\right)\text{ for }n\in U,\,0\text{ else.}$$

This should (probably) be a smooth function on all of $\mathbb{R}^N$ so that $\frac{\mu_k}{b}$ is welldefined and smooth on all of $\mathbb{R}^N\times B_k(0)$, and it clearly is a "candidate" for $c$.
Said differently: If we were dealing with $\mathbb{R}^N\times M$, M a compact manifold, I think the baove gives a solution.

Now choose a filtration $F_i$ of $U$ so that the $F_i$ are open and $\overline{F_i}\subset F_{i+1}$ and choose smooth functions $\nu_k:\mathbb{R}^N\to[0,1]$ so that
$$\nu_k\vert_{F_{k-1}}=0\text{ and }\nu_k\vert_{\mathbb{R}^n\setminus F_k}=1.$$

Finally, define $\mu(n)=\prod_k \mu_k(n)^{\nu_k(n)}$. By the choice of the $\nu$'s this is actually a finite product for each $n\in U$. My hope is that $c=\frac{\mu}{b}$ should do the trick...

If the above construction does not work, is there a different one which does? Or is there a counterexample where one can't choose such a $c$?

Motivation: This problem comes up when considering localizations of injective maps of (finitely generated) $C^\infty$-rings, and whether they stay injective after inverting a single element in the source. I have been trying to either prove it or find a counterexample, and I think it ultimately boils down to the above problem of "straightening out" a function along fibers while preserving its vanishing locus.