String: Fix issue where substrings lost their contents.
Adds new string flag STRING_IS_LOCKED to lock the string data memory.
If a dynamically allocated string (eg "Random.Deterministic") that had
an active substring (eg "Deterministic") later got replaced with a
statically allocated string, the substring would point to freed memory.
Fixes intermittent failures to resolve "Random.Deterministic" in from
Image.Image()->test(), as well as the fatal "Shared string is not zero
terminated properly." from eg _verify_internals().
FIXME: There are most likely still lots of thread race-conditions hiding
with eg I/O operations and this reallocation behavior.