When embedding khash in another project, it is convenient to be
able to replace the use of malloc/calloc/free with alternatives.
This wraps those calls with kmalloc/kcalloc/kfree, etc. macros
that can be easily redefined by the khash user to override the
allocators.
Additionally, the return value from allocations was not being
checked. This adds a check whenever an allocation is performed
and a return code of -1 to indicate an allocation failure.