Avoid memory leaks on calls to realloc with size 0.
Realloc doesn't free memory when called with size 0. All uses of realloc with a potential size 0 argument are replaced with calls to the helper function pw_realloc_or_free.
Realloc doesn't free memory when called with size 0. All uses of realloc with a potential size 0 argument are replaced with calls to the helper function pw_realloc_or_free.