regcomp.c: Don't read outside array bound

This code is only in DEBUGGING builds had an off-by-one error
that would read beyond the end of the array.  This commit also removes
a redundant test