Computation of eigenfrequency sensitivities using Riesz projections for efficient optimization of nanophotonic resonators