jtag/tcl: fix memory leak in error return