mmem: Implement mmem_realloc to properly change an existing allocation