LogPipe: add GlobalConfig parameter to constructors

This patch promotes the GlobalConfig *cfg parameter from log_pipe_init()
to the constructor, so it is already present tha log_pipe_init() time.

This causes a lot of tickle-down effects as all LogPipe derivates must
be changed to add this argument.

This is in preparation for two things:
  * further remove the usage of the global "configuration" variable
  * allow LogPipe methods that get called earlier than _init()
  * the configuration instance is always available, in every
    LogPipe instance, not just those where log_pipe_init() was called
    with a non-NULL pointer.

It is still possible to reassign a LogPipe instance to a different
GlobalConfig by calling the log_pipe_set_config() method, but now that is
the exception and not the norm.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
afsocket: avoid stale cfg pointer in AFSocketSourceConnection->reader

AFSocketSourceConnection instances are propagated upon reload from the old
to the new configuration, thus its LogPipe->cfg pointers has to
be updated both in AFSocketSourceConnection and its LogReader instance.

LogReader instances do not use their cfg pointers, so it used to be NULL,
prior to introducing the GlobalConfig *cfg argument to the LogPipe
constructor. I wanted to change this and make cfg always present, which
means that it has to be maintained, that's what this patch does.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
affile: avoid stale cfg pointer in AFFileDestWriter->writer

AFFileDestWriter instances are propagated upon reload from the old
to the new configuration, thus its LogPipe->cfg pointers has to
be updated both in AFFileDestWriter and its LogWriter instance.

LogWriter instances do not use their cfg pointers, so it used to be NULL,
prior to introducing the GlobalConfig *cfg argument to the LogPipe
constructor. I wanted to change this and make cfg always present, which
means that it has to be maintained, that's what this patch does.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
LogPipe: reduce the use of the "configuration" global

Now as LogPipe gets a GlobalConfig instance in its constructor we can avoid
using the global variable directly.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
WIP: prepare_config method
Merge pull request #79 from balabit/3.6/f/add-prepare-config-method-to-logpipe

3.6/f/add prepare config method to logpipe