Transverse oscillations of coronal loops are often observed and have been theoretically interpreted as kink magnetohydrodynamic (MHD) modes. Numerical simulations by Terradas et al. suggest that shear flows generated at the loop boundary during kink oscillations could give rise to a Kelvin-Helmholtz instability (KHI). Here, we investigate the linear stage of the KHI in a cylindrical magnetic flux tube in the presence of azimuthal shear motions. We consider the basic, linearized MHD equations in the beta = 0 approximation and apply them to a straight and homogeneous cylindrical flux tube model embedded in a coronal environment. Azimuthal shear flows with a sharp jump of the velocity at the cylinder boundary are included in the model. We obtain an analytical expression for the dispersion relation of the unstable MHD modes supported by the configuration, and compute analytical approximations of the critical velocity shear and the KHI growth rate in the thin tube limit. A parametric study of the KHI growth rates is performed by numerically solving the full dispersion relation. We find that fluting-like modes can develop a KHI in timescales comparable to the period of kink oscillations of the flux tube. The KHI growth rates increase with the value of the azimuthal wavenumber and decrease with the longitudinal wavenumber. However, the presence of a small azimuthal component of the magnetic field can suppress the KHI. Azimuthal motions related to kink oscillations of untwisted coronal loops may trigger a KHI, but this phenomenon has not been observed to date. We propose that the azimuthal component of the magnetic field is responsible for suppressing the KHI in a stable coronal loop. The required twist is small enough to prevent the development of the pinch instability.