templates: fix up FD number conflict

* agen5/agShell.c (ag_scm_shellf): shell_cmd() *can* return NULL.
* agen5/autogen.c (exit_cleanup): reset trace_fp to stderr after close
* autoopts/tpl/str2mask.tpl: only scan over characters that are in
  the list of mask names.
* agen5/test/str2m.test: adjust test
* autoopts/tpl/getopt.tpl: die if autogen exits non-zero
* autoopts/tpl/usage.tlib: fd 8 is always used, so do not use it in
  this template script.  Replace "8" with "7".
tpl: Ensure non-flag-char values are not chars

* autoopts/tpl/opthead.tlib: set the option values to high values
  when auto-supported options do not have associated flag chars.
* autoopts/test/defs.in: ensure that nested invocations of
  autogen add their trace output to the trace log file.
* autoopts/test/getopt.test: reorganize so that the scripting is
  easier to follow.
* autoopts/tpl/usage.tlib: preserve the scratch directory when
  VERBOSE is set to "true".
fix all non-flag values

non-flag character option values will now start with 0x1001.
The counter will be incremented with each option that does
not have a flag character.

* autoopts/tpl/optlib.tlib: define the counter and a function
  that returns its incremented value.  Use that function
  for emitting the "#define VALUE_OPT_..." preprocessing macro.
* autoopts/tpl/opthead.tlib: likewise for the auto-supported
  options ("help", et al.)
* doc/auto-opts.tlib: the option count constraint is now
  4,000 not 100.