fix kore_realloc() to actually behave properly