tl;dr: It is not currently a factor limiting the ultimate precision of how closely you can make a system oscillate to that defined frequency. To address your question specifically: each atom will absorb or emit photons at a random energy due to what you stated, but an ensemble of such atoms will average out to a distribution with a well-defined centre energy.
The linewidth of a transition only limits how narrow the spectrum you measure can be, it does not place a limit on how well you can determine the centre of that transition's spectrum. However a narrower line makes it easier to determine the centre: if you make $N$ measurements (or replace $N$ with an integration time $\tau$ if you want), the uncertainty is $\sigma/\sqrt{N}$ where $\sigma$ is the uncertainty of a single measurement. Thus if you want to get your uncertainty down by a factor of 10 you need to make 100 times as many measurements. If you can just switch to a transition with a linewidth that's 10 times smaller instead, your job is significantly easier.
At the risk of insulting the reader's intelligence, an illustration: the shape of an atomic transition is usually well-modelled by a Lorentzian (aka Cauchy distribution). Try to guess where the centre of this one (with width parameter $\gamma = 1$) is:
Probably 0, right? Now a curve with the same centre but $\gamma = 0.05$ and a narrower range of x values:
Ah! It's not centred at zero, but we can only tell easily because it has a narrower linewidth. In a real measurement where there's noise perturbing this curve, we could have found the centre of either to the same precision but only by taking a lot more data in the first case. As described in Alwin's answer there are also other effects which can shift the centre of a transition rather than just broadening it (often called systematic effects, or just systematics), which are usually bigger problems than the width of the line since you have to correct for them, and it's hard to know exactly how strong the perturbing effect is in the region where the atoms are. Look up co-magnetometers in neutron EDM measurements for a clever example of solving a similar problem.
There are also various methods used to narrow the spectrum you measure below the natural linewidth, the most prominent of which is known as Ramsey spectroscopy (or Ramsey interferometry, or the separated oscillatory fields method, or...), which got Mr. Ramsey a Nobel, to give you an idea of how important it is. It's difficult to give a short explanation, but in essence you drive the transition with two pulses separated in time, and in two types of experiment: with the radiation in the pulses being in phase, and 180 degrees out of phase, and subtract the measured spectrum from each case. The width of the resultant lineshape is then determined completely by the time separation between the pulses. This is due to some of the atoms being excited in the first pulse, some in the second, and acquiring a different quantum-mechanical phase of $\Delta E T / \hbar\space$ (where $\Delta E$ is the energy difference between the two states and T is the time separation of the pulses), which then causes interference when you measure the population of the atoms which have undergone a transition (image of such a lineshape from here):
However, you're still limited by the lifetime of the state $\tau$, as making $T$ larger decreases the amplitude of the signal you measure by a factor of $e^{-T/\tau}$. To toot my own horn a little, I've used a variation of this method to measure a transition in helium with a natural linewidth of 3.6 MHz to a precision of 25 Hz, where the uncertainty was dominated by how well we could control these perturbing effects - if we ignored those and just used the statistical uncertainty, it would have been 2 Hz. For another comparison, hydrogen masers use the 21 cm hydrogen line which has a lifetime of about 10 million years, and a natural linewidth of ~$10^{-15} \space \text{Hz}$, but when realised as a system they usually have a linewidth of several Hz due to all the broadening effects and finite cavity quality factor.