Close streams in agent before waiting for cert

This was causing stdout to remain open while waiting for the cert, even
when daemonizing, which causes the init script to not return when
redirecting output.

This is a partial revert of c2c082381895954c25357b1ca87ad86ab3532c5c
"(#13584) in daemon mode, master can swallow errors during startup"
(Maint) Remove unused and unreachable logging configuration

The --centrallogging tried to setup some sort of central aggregation of
logs (see issue #51). However at some point in the past the
--centrallogging flag was disconnected from the internal handling of
this (the code assumed it was called :centrallogs). However, even fixing
that disconnect would not have made this work because the logging system
does not appear to support this kind of setup. The :host logging
destination depends on a class called
Puppet::Network::Client::LogClient, which does not exist.

This simply removes all of that code, including the handling of the
command line options. This results in any user who had been passing
those flags now recieving an error, however, since these were never
documented anywhere that I can find, this is an acceptable risk.
(#21055) Push setup of agent closer to where it is used

This pushes the initialization of different parts of the agent under
various circumstances closer to where the pieces are used. By reducing
the "live-time" of the code the risk of bugs related to partial
initialization is reduced.

Because of the internal refactorings and the tight coupling of the tests
to these internal control flows, many of the tests have been reworked to
take a much more outside-in approach and now mostly (but not completely)
test through a more "public" interface.
(#21055) Ensure that only logging is used after daemonization

When the point at which streams are closed was changed from
Puppet::Daemon#start to Puppet::Daemon#daemonize the error message for
onetime would be lost. This is made slightly more obvious (although
admittedly not much) by pulling daemonization as close as possible to
where it is finally started. The lost message is then solved by
switching from $stderr.puts to Puppet.err for issuing the message.
(Maint) Remove duplication from more agent tests

The inclusion of `execute_agent` was not used in all of the places it
could be. This uses it more thoroughly, but still not constantly since
there are still many tests that work from small, internal methods that
would need to be reworked.
Merge pull request #1690 'zaphod42/issue/master/21055-agent-holding-stdout-open'

* zaphod42/issue/master/21055-agent-holding-stdout-open:
  (Maint) Remove duplication from more agent tests
  (#21055) Ensure that only logging is used after daemonization
  (#21055) Push setup of agent closer to where it is used
  (Maint) Remove unused and unreachable logging configuration
  Close streams in agent before waiting for cert