fix issue with excessive mremap syscalls on realloc