Use of the beat frequency between two modes for frequency stabilization of internal-mirror lasers