bitarray: full multidimensional bounds checks

Fix #2495