Fix unsigned integer overflow in IO buffer allocator