Energy Confinement and MHD Activity in Shaped TCV Plasmas with Localized Electron Cyclotron Heating