First of all, let us compute $ \lim\limits_{x\to 0}{\frac{\mathrm{e}^{-x}+x-1}{x^{2}}} $:
Notice that for any $ t\in\mathbb{R} $, $ \left|\mathrm{e}^{t}-1\right|=\left|t\right|\left|\int_{0}^{1}{\mathrm{e}^{xt}\,\mathrm{d}x}\right|\leq\left|t\right|\int_{0}^{1}{\mathrm{e}^{x\left|t\right|}\,\mathrm{d}x}\leq\left|t\right|\mathrm{e}^{\left|t\right|} \cdot $
Observe that : \begin{aligned} \frac{\mathrm{e}^{-x}+x-1}{x^{2}}&=\int_{0}^{1}{\left(1-y\right)\mathrm{e}^{-xy}\,\mathrm{d}y}\\ &=\frac{1}{2}+\int_{0}^{1}{\left(1-y\right)\left(\mathrm{e}^{-xy}-1\right)\mathrm{d}y} \end{aligned}
Since $ \left|\int_{0}^{1}{\left(1-y\right)\left(\mathrm{e}^{-xy}-1\right)\mathrm{d}y}\right|\leq\int_{0}^{1}{\left(1-y\right)\left|\mathrm{e}^{-xy}-1\right|\mathrm{d}y}\leq \left|x\right|\int_{0}^{1}{y\left(1-y\right)\mathrm{e}^{\left|x\right|y}\,\mathrm{d}y}\underset{x\to 0}{\longrightarrow}0 $, we get :
$$ \frac{\mathrm{e}^{-x}+x-1}{x^{2}}\underset{x\to 0}{\longrightarrow}\frac{1}{2} $$
And thus : \begin{aligned}\lim_{x\to 0}{\frac{x\,\mathrm{e}^{x}-\mathrm{e}^{x}+1}{x\left(\mathrm{e}^{x}-1\right)}}&=\lim_{x\to 0}{\left(\frac{\mathrm{e}^{-x}+x-1}{x^{2}}\times\frac{x}{1-\mathrm{e}^{-x}}\right)}\\ &=\frac{1}{2}\times 1\\ \lim_{x\to 0}{\frac{x\,\mathrm{e}^{x}-\mathrm{e}^{x}+1}{x\left(\mathrm{e}^{x}-1\right)}}&=\frac{1}{2}\end{aligned}