Macro generating lambda containing `ident("auto")` and `genSym` causes SIGSEGV
### Description

The macro `aBug` defined below generates the following code:

```nim
# echo repr result:
map(proc (val: auto): void =
  let variable_536870972 = 123)
```

Calling the macro crashes with `SIGSEGV: Illegal storage access. (Attempt to read from nil?)`.
It seems to be caused by a combination of the use of `genSym`, and `auto` as the type for the lambda parameter `val`.

## Reproduction
```nim
import macros

proc map(fn: proc(val: int): void) = fn(1)

# This works fine, and is the exact same function call as what's
# generated by the macro `aBug`.
map proc(val: auto): void =
  let variable = 123

macro aBug() =
  # 1. let sym = ident("variable")
  let sym = genSym(nskLet, "variable")
  let letStmt = newLetStmt(sym, newLit(123))

  let lambda = newProc(
    params = @[
      ident("void"),
      newIdentDefs(ident("val"), ident("auto")),
      # 2. newIdentDefs(ident("val"), ident("int")),
    ],
    body = newStmtList(letStmt),
    procType = nnkLambda
  )

  result = newCall(bindSym("map"), lambda)

  echo repr result
  echo treeRepr result

aBug()
```


Using 1. `ident` instead of `genSym` doesn't crash but doesn't generate a unique name.
Using 2. `int` instead of `auto` as the type for `val` doesn't crash.

### Nim Version

Nim Compiler Version 2.0.8 [MacOSX: amd64]
Compiled at 2024-09-02
Copyright (c) 2006-2023 by Andreas Rumpf

### Current Output

```text
SIGSEGV: Illegal storage access. (Attempt to read from nil?)

# echo treeRepr result:
Call
  Sym "map"
  Lambda
    Empty
    Empty
    Empty
    FormalParams
      Ident "void"
      IdentDefs
        Ident "val"
        Ident "auto"
        Empty
    Empty
    Empty
    StmtList
      LetSection
        IdentDefs
          Sym "variable"
          Empty
          IntLit 123
```


### Expected Output

_No response_

### Known Workarounds

_No response_

### Additional Information

_No response_