Fixed realloc() failure handling.
Fixed realloc() failure handling.

According to POSIX, if realloc() fails to allocate a new chunk of memory
it returns NULL and does not free the original pointer.

Using a separate pointer in order to preserve the original one.

nginx/njs,nginx/njs,nginx/njs,nginx/njs,nginx/njs,nginx/njs