nimscript.exec with input parameter raises, while gorge and gorgeEx work fine.
### Description

I have observed the same issue before, the unzip example is arbitrary. Bellow I copy-pasted the body of exec in a new function myExec, which works correctly. `exec` although being identical, fails for no apparent reason!

```nim
mode = ScriptMode.Verbose

# Prepare, need zip, unzip packages
exec "touch empty.txt"
exec "zip test.zip empty.txt"

# Works fine
echo gorge("unzip -q test.zip -d android-sdk", input = "N")

template log(msg: string, body: untyped) =
  if mode in {ScriptMode.Verbose, ScriptMode.Whatif}:
    echo "[NimScript] ", msg
  if mode != ScriptMode.Whatif:
    body

proc myExec*(command: string, input: string, cache = "") {.
  raises: [OSError], tags: [ExecIOEffect, WriteIOEffect].} =
  log "exec: " & command:
    let (output, exitCode) = gorgeEx(command, input, cache)
    if exitCode != 0:
      raise newException(OSError, "FAILED: " & command)
    echo output

# Also works fine
myExec("unzip -q test.zip", input = "N")

# unzip:  cannot find or open test.zip, test.zip.zip or test.zip.ZIP.
exec("unzip test.zip", input = "N") # exitCode 9
```

### Nim Version

```
Nim Compiler Version 2.1.1 [Linux: amd64]
Compiled at 2024-07-09
Copyright (c) 2006-2024 by Andreas Rumpf

git hash: 5c5e7a9b6e9ed0c860030f798d4a7096b51b6bda
active boot switches: -d:release
```

### Current Output

The myExec procedure works as expected. The exec procedure fails.

```text
unzip:  cannot find or open test.zip, test.zip.zip or test.zip.ZIP.
stack trace: (most recent call last)
test.nims(22, 5)
Nim/lib/system/nimscript.nim(274, 7) exec
Nim/lib/system/nimscript.nim(274, 7) Error: unhandled exception: FAILED: unzip test.zip [OSError]
```

### Expected Output

Both myExec and exec should successfully execute the command without errors.
