Automatic frequency control for solid-state sources in electron spin resonance