Let $M,N$ be real smooth manifolds and $p\colon M\to N$ a smooth map. Then smooth functions on $M$ form a module over the ring of smooth functions on $N$ (via pullback). Is it know whether this module is flat when $p$ is a submersion?

Recall that flatness is equivalent to the following: 
whenever $ h_1 \ldots h_k\in C^\infty(N) $ and $g_1 \ldots g_k\in C^\infty(M)$ are such that:
$$h_1 g_1 + \ldots + h_k g_k = 0$$ (as functions on $M$)
then there are functions $G_1 \ldots G_r\in C^\infty(M)$ and $a_{i,j}\in C^\infty(N)$ such that:
$$g_i= \sum_j  a_{i,j}G_j \; \forall i $$ 
and 
$$\sum_i h_i a_{i,j}= 0 \; \forall j$$

Some remarks:

- This condition of flatness is equivalent to the usual one (see the comments below).

- It is known that the inclusion of an open subset $U\subset N$ is a flat morphism since smooth functions on $U$ are obtained from the smooth functions on $N$ by localizing w.r.t. functions vanishing nowhere on $U$.

- It is also known that a smooth flat map has to be open. Proofs of both of these facts can be found for example in the book: Gonzales, Salas, $C^\infty$-differentiable spaces, Lecture notes in Mathematics, Springer 2000.

- The equational condition of flatness given above seems to be the most reasonable thing to use trying to come up with a proof. But considering already the simplest situation here's what gets me stuck: suppose you want to check flatness of the standard projection $\mathbb{R}^2 \to \mathbb{R}, (x,y)\mapsto x$, and take the case of just one $h\in C^\infty(\mathbb{R})$ and one $g\in C^\infty(\mathbb{R}^2)$ with $hg=0$. If you pick $h(x)$ to be strictly positive for $x<0$ and $0$ for $x\geq 0$, then the flatness condition translates into: 

Any smooth function $g(x,y) \in C^\infty (\mathbb{R}^2)$ that vanishes on the half plane $x\leq 0 $ admits a "factorization":
$$g(x,y)= \sum_j a_j (x)G_j (x,y)$$
where the $a_j\in C^\infty(\mathbb{R})$ all vanish on $x\leq 0$ and the $G_j\in C^\infty(\mathbb{R}^2)$ are arbitrary.

Anyone has an idea how to prove this "simple" case, or sees a counter example?