Stability and energy confinement of highly elongated plasmas in TCV