Memory issues with HashTable when resizing
As I read file `pandas/_libs/src/klib/khash.h`, I notice lines 226, 227 in macro `kh_resize_##name` ([source](https://github.com/pandas-dev/pandas/blob/master/pandas/_libs/src/klib/khash.h#L226))
```
h->keys = (khkey_t*)realloc(h->keys, new_n_buckets * sizeof(khkey_t)); \
if (kh_is_map) h->vals = (khval_t*)realloc(h->vals, new_n_buckets * sizeof(khval_t)); \
```
If realloc fail in either statement, it set h->keys or h->vals to NULL and leak original pointer value. Any attempt to deref new value of h->keys or h->vals will lead to undefined behaviors.

Should we assign result of memory allocation to a temporary variable and perform check before reassign to HashTable's internal data?