[Chapel Merge] Fix a bug that's caused by null bytes in `regex.su

Branch: refs/heads/main
Revision: 7c2b001
Author: e-kayrakli
Log Message:

Merge pull request #18288 from e-kayrakli/regex-subn-null-bug

Fix a bug that's caused by null bytes in regex.subn

When replacing a substring with a null byte, we were passing the c_string
returned by the qio_regex_replace directly into string factory functions.
However, that implies using null byte as the terminator. We have to pass the
length of the buffer for correct operation.

[Trivial, not reviewed]

Test: