Segfault in nimlangserver when `-d:nimOptIter` is defined
### Description

Download and build latest https://github.com/nim-lang/langserver
Remove the lock file and the requires from the `nimlangserver.nimble` so it uses the latest Nim to build. 
Run `nimble build`
Open a nim project with the vscode extension (make sure the built `nimlangserver` is the one used)

It will crash with the following (you can see the output in the `Nim Language Server` tab or `Nim Lsp` if you are running a newer version)

Works fine with `2.0.8` and with `2.0.9`

```
Traceback (most recent call last)
/Volumes/Store/Nim/lib/system/deepcopy.nim(190) genericDeepCopy
/Volumes/Store/Nim/lib/system/deepcopy.nim(132) genericDeepCopyAux
/Volumes/Store/Nim/lib/system/deepcopy.nim(72) genericDeepCopyAux
/Volumes/Store/Nim/lib/system/deepcopy.nim(68) genericDeepCopyAux
/Volumes/Store/Nim/lib/system/deepcopy.nim(153) genericDeepCopyAux
SIGSEGV: Illegal storage access. (Attempt to read from nil?)
```



### Nim Version

```
Nim Compiler Version 2.1.99 [MacOSX: arm64]
Compiled at 2024-09-10
Copyright (c) 2006-2024 by Andreas Rumpf

git hash: baec1955b5453ec71fc12355142dd9a813fa02fb
```

### Current Output

_No response_

### Expected Output

_No response_

### Known Workarounds

_No response_

### Additional Information

_No response_