terminal: fix checkptr failure under -race for cgo.Handle userdata
Converting a cgo.Handle (uintptr) directly to unsafe.Pointer in
NewTerminal triggered a checkptr "bad pointer value" panic when
running tests with -race. The handle is an opaque integer, not a
real Go pointer, so checkptr incorrectly rejects it.
Extract the conversion into a small handleToPointer helper
annotated with //go:nocheckptr to suppress the false positive.