Stabilization of tearing modes in tokamaks using electron cyclotron heating