tgsi: fix out-of-bounds access for cube arrays