zsys: don't leak string when realloc fails

We are not interested in realloc since the string is rewritten
in full anyway.  Switch to a more explicit free/malloc style.