While @Prahar's answer is correct when it comes to the exponential behaviour, i.e. the zero-mode, I disagree with their way of obtaining the prefactor. The $\frac{1}{g}$ behaviour is crucial and not a matter of normalisation. In particular, they disregard that in such computations one must zeta-function regularise the resulting determinants$^*$.
Before delving into the non-zero-mode sector let me outline the effect of the zero-mode for the sake of completeness. If we decompose $a$ into $a= a_0 + a'$, where $a_0$ is a constant (the zero-mode) and $a'$ are non-constant, non-winding, periodic functions (and thus $\int_0^1 \mathrm{d}\tau \;a' = 0$), it is clear that
$$\int_0^1\mathrm{d}\tau a = a_0$$
and $\mathrm{D}a=\mathrm{d}a_0\; \mathrm{D}a'$. Then the delta-function will only affect the zero mode, and hence
$$Z=\int \mathrm{d}a_0\ \delta\left(a_0-\bar{\mu}\right)\ \mathrm{e}^{-{a_0^2}/{g^2}}\ Z_\text{non-zero-mode}[g] = \exp\!\left(-\frac{\bar{\mu}^2}{g^2}\right)\ Z_\text{non-zero-mode}[g].$$
Now, the non-zero-mode sector is Gaussian and free of constraints and reads simply
$$\begin{aligned} Z_\text{non-zero-mode}[g] &= \int \mathrm{D}a' \exp\!\left(-\frac{1}{g^2}\int \mathrm{d}\tau \ a^2\right) = \\ &= \left[\det'\!\left(\frac{1}{g^2}\mathbb{I}\right)\right]^{-1/2} = \\ &= \left(\prod_{n\neq 0} \frac{1}{g^2}\right)^{-1/2} = \prod_{n=1}^\infty g^2 \overset{\zeta}{=} \frac{1}{g}.\end{aligned}$$
where $\mathbb{I}$ is the identity operator acting on the space of periodic functions and $\det'$ excludes the zero mode, which is treated separately above. The last equality is understood in zeta-function regularisation$^\dagger$
In total we have
$$\begin{aligned}Z[g,\bar{\mu}] &=\int\mathrm{D}a\ \delta\left(\int_0^1\mathrm{d}\tau a - \bar{\mu}\right)\ \exp\!\left(-\frac{1}{g^2}\int\mathrm{d}\tau a^2\right)=\\
&=Z_\text{non-zero-mode}[g,\bar{\mu}]\ Z_\text{zero-mode}[g,\bar{\mu}] = \\
&= \frac{1}{g}\ \exp\!\left(-\frac{\bar{\mu}^2}{g^2}\right),
\end{aligned}$$
getting the desired answer.
$^*$ As indeed noted by @Prahar in a comment, one can use a different regularisation method and should get the same $g^{-1}$ behaviour. One cannot however simply set the normalisation of the partition function to get the desired result, as the normalisation is already fixed in this case.
$^\dagger$ Remember that $\prod_{n=1}^\infty \text{constant} \overset{\zeta}{=} \exp(\log(\text{constant})\ \zeta(0))=\frac{1}{\sqrt{\text{constant}}} $.