Cast seq to string, heap buffer overflow with stdlib assuming terminating '\0'
### Description

```nim
import std/sequtils

proc foo(x: string) =
  echo x & "abc"

foo(cast[string](repeat('a', 6)))
```

The error log points to this code:

```c
T3_ = rawNewString(x_p0.len + 3);appendString((&T3_), x_p0);appendString((&T3_)
```

```nim
proc appendString(dest: var NimStringV2; src: NimStringV2) {.compilerproc, inline.} =
  if src.len > 0:
    # also copy the \0 terminator:
    copyMem(unsafeAddr dest.p.data[dest.len], unsafeAddr src.p.data[0], src.len+1)
    inc dest.len, src.len
```

### Nim Version

Nim Compiler Version 2.1.9 [Linux: amd64]
Compiled at 2024-08-24
Copyright (c) 2006-2024 by Andreas Rumpf

git hash: 7c59987dbd90ae397cd105e37d9b0661696ef669
active boot switches: -d:release

### Current Output

```text
==17157==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x50200000001e at pc 0x557b49ab4776 bp 0x7ffd61f1a6f0 sp 0x7ffd61f19eb0
READ of size 7 at 0x50200000001e thread T0

    #0 0x557b49ab4775 in __asan_memcpy (raydev/raylib-examples/personal/test_sh+0x11b775) (BuildId: 3f333f850346810698a930c911bc300384afb4fc)
    #1 0x557b49b0c2f8 in nimCopyMem Nim/lib/system/memory.nim:10:24
    #2 0x557b49b0c2f8 in system::copyMem(pointer, pointer, range09223372036854775807) Nim/lib/system.nim:2076:2
    #3 0x557b49b0c2f8 in appendString Nim/lib/system/strs_v2.nim:116:355
    #4 0x557b49b0c02a in test_sh::foo(string) raydev/raylib-examples/personal/test_sh.nim:4:230
    #5 0x557b49b0c67f in NimMainModule raydev/raylib-examples/personal/test_sh.nim:6:173
    #6 0x557b49b0c67f in NimMainInner Nim/lib/system.nim:399:2
    #7 0x557b49b0c67f in NimMain Nim/lib/system.nim:410:2
    #8 0x557b49b0c67f in main Nim/lib/system.nim:418:2
    #9 0x7f50b2cc1e07 in __libc_start_call_main /usr/src/debug/glibc/glibc/csu/../sysdeps/nptl/libc_start_call_main.h:58:16
    #10 0x7f50b2cc1ecb in __libc_start_main /usr/src/debug/glibc/glibc/csu/../csu/libc-start.c:360:3
    #11 0x557b499cc0c4 in _start (raydev/raylib-examples/personal/test_sh+0x330c4) (BuildId: 3f333f850346810698a930c911bc300384afb4fc)

0x50200000001e is located 0 bytes after 14-byte region [0x502000000010,0x50200000001e)
allocated by thread T0 here:
    #0 0x557b49ab81a9 in malloc (raydev/raylib-examples/personal/test_sh+0x11f1a9) (BuildId: 3f333f850346810698a930c911bc300384afb4fc)
    #1 0x557b49b03f16 in newSeqPayloadUninit Nim/lib/system/seqs_v2.nim:55:773

SUMMARY: AddressSanitizer: heap-buffer-overflow (raydev/raylib-examples/personal/test_sh+0x11b775) (BuildId: 3f333f850346810698a930c911bc300384afb4fc) in __asan_memcpy
Shadow bytes around the buggy address:
  0x501ffffffd80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x501ffffffe00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x501ffffffe80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x501fffffff00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x501fffffff80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x502000000000: fa fa 00[06]fa fa fa fa fa fa fa fa fa fa fa fa
  0x502000000080: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x502000000100: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x502000000180: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x502000000200: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x502000000280: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07 
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
==17157==ABORTING
```


### Expected Output

_No response_

### Possible Solution

I wouldn't put blame on https://github.com/nim-lang/Nim/pull/24004 as the same bug was possible before but it happened on the `=dup(cast[string](x))` call.

### Additional Information

nimPNG is affected as it [uses](https://github.com/jangko/nimPNG/blob/master/nimPNG.nim#L1895) string internally.