regcomp.c: Don't exceed array bounds

The upper limit of this loop was wrong.  It should be the number of
Posix classes that have space stored for them.  This caused a valgrind
error, but it's only when outputting a regular expression under, for
example,  -Dr
regcomp.c: Improve -Dr output

Sometimes sequences like [\w\s] were output as separate classes
[\w][\s].  And sometimes, an empty [] was output.  This fixes those and
eliminates all but one call to a macro, which is hence now just in-lined.