`lent` pointer outlives origin for global/threadvar
### Description

This compiles even though the returned lent pointer outlives the threadvar value. Same for globals. Try `-d:useMalloc` for a random output.

```nim
type Foo = ref object
  x: seq[int]

var foo {.threadvar.}: seq[Foo]

proc genfoo(): lent Foo =
  foo = @[Foo(x: @[1,2,3])]
  return foo[0]

proc echoFoo() =
  var x = genfoo()
  foo[0] = nil
  foo.setLen 0
  echo x[].x
  echo x[].x.len
echoFoo()
```

### Nim Version

Nim Compiler Version 2.3.1 [Linux: amd64]
Compiled at 2025-01-18
Copyright (c) 2006-2025 by Andreas Rumpf

git hash: 2af9ddc286b4f0c6d467fb7a95a60a1e10437744
active boot switches: -d:release

### Current Output

```text
@[1, 2, 3]
23859
```

### Expected Output

Compilation error (or it should copy in this case?).

### Known Workarounds

_No response_

### Additional Information

_No response_