Measurement of the linewidth of a continuous-wave laser with a cavity-length modulation technique