configure: Fixed inclusion of krb5 when CURL_DISABLE_CRYPTO_AUTH is defined

Commit fe0f8967bf fixed a problem with krb5 not being defined as a
supported feature when HAVE_GSSAPI is defined, however, it should
only be included if CURL_DISABLE_CRYPTO_AUTH is not set, like when
SPNEGO is listed as a feature.
cmake: fix NTLM detection and add krb5 feature

Based on recent configure patches:

    eda919f configure: Added krb5 to the supported features
    f0d860d configure: Fixed NTLM missing from features when CURL_DISABLE_HTTP defined
    fe0f896 configure: assume krb5 when gss-api works
    676d62f configure: Fixed inclusion of krb5 when CURL_DISABLE_CRYPTO_AUTH is defined

Signed-off-by: Peter Wu <peter@lekensteyn.nl>
tests: use single quotes for some tests

This prepares for a future patch where commands are not executed by a
shell anymore, but by perl. In the future, Text::ParseWords will be used
to convert a command to an array.

According to 2.2.3 Double-Quotes, chapter Shell Command Language of
The Base Specifications Issue 6 (IEEE Std 1003.1 2004), double quotes
should not touch characters other than

    $ ` " \ <newline>

Unfortunately, perls Text::ParseWords does not handle this correctly,
removing the slash for everything else. Avoid this incompatibility by
using single quotes instead.

Signed-off-by: Peter Wu <peter@lekensteyn.nl>
tests/test22: expand a backtick command

This is the only user of the backtick operator in the command. As the
commands will soon not be executed by a shell anymore (but by perl),
replace the command with its output.

Signed-off-by: Peter Wu <peter@lekensteyn.nl>
runtests.pl: safer system() calls

Command invocation via runclient() (which calls system()) using a string
invokes the shell. This has the problem that tests which load
libhostname.so via LD_PRELOAD break when the library cannot be loaded
into the shell (when cURL is built with AddressSanitizer for example).

Fix this issue by making runclient() use fork/exec/open instead of
system to bypass sh. Note that sh is only bypassed if curl is a binary
as is the case with cmake or with the curl binary installed via `make
install`. This patch does not fix the issue with the libtool wrapper of
autotools.

precheck is now also wrapped into runclient rather than using backticks
to take advantage of the sh bypass.

Implementation details: as runclient has become more sophisticated and
can also return stdout, get rid of runclientoutput.

Note for the curious: previously a gdb invocation would feed stdin via
'set args <input'. This only works because the command is interpreted as
a shell command. After this patch stdin is fed directly.

Detection of the `valgrind --tool` option was previously done by
invoking grep. Remove this use of grep. While at it, remove
`valgrind --version` invocation to determine whether `--log-file`
should be used instead of `--logfile`. Parse this information directly
from `valgrind --help` which was executed earlier.

As for differences in log file, these are just whitespace (trailing
space for `curl --version` command, spaces after redirection operator)
and quoting (quotes typically get stripped).

Signed-off-by: Peter Wu <peter@lekensteyn.nl>
runtests.pl: simplify command environment handling

Rather than saving valid environment variables for restoration later,
use 'local' to limit the environment changes to the block executing
a command.

Rationale: LD_PRELOAD may not work with all executables. Previously
it would break on the shell when compiled with AddressSanitizer
(-fsanitize=address), but that is avoided by not executing string
commands anymore. gdb would still be executed with LD_PRELOAD though,
so setting $ENV in this way was not sustainable.

After this patch, environment variables are passed to executions of
precheck (for chkhostname), command (for curl) and postcheck (for
symmetry with precheck, it does not actually use it).

Note that this patch does not help with an autotools build which uses
shared libs and AddressSanitizer as the 'curl' program is a libtool
wrapper (shell script).

Signed-off-by: Peter Wu <peter@lekensteyn.nl>
runtests.pl: fix shell escape parsing

Signed-off-by: Peter Wu <peter@lekensteyn.nl>