cleanup realloc.
Cleanup kernel code for message allocation/deallocation.