Fix bug computing array indices.

When the index type was BOOLEAN, i1 1 was being
extended (using [sext]) to i32 -1 causing problems.
Instead we now use [zext] which gives the desired
i32 1 instead of i32 -1.