Measurement of beam waist for an optical cavity based on Gouy phase