Measuring frequency fluctuations in nonlinear nanomechanical resonators