Fix compilation on Linux x86_64.

Here, size_t is long unsigned int, which is not the same size as
unsigned int.

Since bai is the result of std::vector::size(), which is defined to have
type std::vector::size_type, let's use that throughout.