Symmetry of extremals of functional inequalities via spectral estimates for linear operators