[ASan] One more fix for realloc: check that reallocated chunk is valid before calling memcpy