Fix crash during destruction of second channel when variable set with setvar.