ta: check overflow in array realloc macros