Resonant electrodynamic heating and the thermal stability of coronal loops