Fix ordering problem in AC_CONFIG_FILE actions.

The chmod action statements need to be put in individual
AC_CONFIG_FILE statements that generate the target file in question.
With the original code, the 2 chmod statements were executed for
''each'' file in the AC_CONFIG_FILES block (resulting in both error
messages before the files were created, and needless chmods after the
files were created).
Clean up variables used in configure with OPAL_VAR_SCOPE.

This is helpful in the work for #3694: ensure that many places that
eventually end up in configure don't overly-pollute the global shell
variable space (because debugging accidental shell variable pollution
can be a real pain).

Refs #3694