Resonance between electronic and rotational motions in Rydberg states of CaF