Fix ws string reallocs

Includes guards in case realloc fails.