Fix krealloc

It was fairly badly broken.

It's legal to call with a NULL pointer.

It's required to save the old contents to new :-), else it's not much of a RE-allocator.

Signed-off-by: Ronald G. Minnich <rminnich@google.com>