lib/genalloc: fix the overflow when size is too big