This results in memory leaks. The fix is to use `runtime.SetFinalizer` (see e.g. https://github.com/emersion/go-tsm/blob/master/vte.go#L47).