Your $\cos$ construction can be easily mimicked in the setting you are interested in as well. Let $d=1$.

Let $\mu=pe^{-V}$, $g(x)=A\cos(ax)$ where $p,V,A,a$ are to be chosen. We'll take $p$ and $V$ even in addition to your properties. Then the stationary point equation is $\log p+(pe^{-V})*g=\text{const}$. The first stationary point will be just $p=[\int e^{-V}]^{-1}$ . That merely requires that the Fourier transform of $e^{-V}$ vanishes at $a$, which is easy to achieve, and leaves the $A$ parameter completely free. 

Now take $p=e^{\delta\cos(at)}[\int e^{\delta\cos(at)}e^{-V}]^{-1}$. Then $\log p=\delta\cos(at)$  while $pe^{-V}*g=c(\delta)\cos(at)$ with $c(\delta)\ne 0$ at least for small $\delta$ (and then, due to the real analyticity for almost all $\delta$). That is because 
$$
\int e^{\delta\cos(at)}e^{-V}\cos(at)=\delta\int e^{-V}\cos^2(at)+ O(\delta^2)
$$
from the Taylor expansion of $\exp$. But then we can easily adjust $A$ to get it stationary too.