affile: Restore fsync & flush-lines functionality

Back in May, in 101cb379, which moved fsync() from logtransport to
logproto, a new argument for log_proto_file_writer_new() was
introduced, but when updating the call sites, the flush_lines and
fsync arguments were mixed up.

This corrects that, restoring both flush-lines() and fsync()
functionality for the file destination.

Reported-by: Evan Rempel <erempel@uvic.ca>
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
logrewrite: fix rewrite set/subst related segfault

If a set/rewrite operation is referenced from multiple locations, and
it uses template functions, a segfault has occurred, as the clone
operation didn't properly propagate the associated configuration object,
which rendered template->cfg to be NULL, which in turn caused
template-function lookup code to dereference a NULL pointer.

This was fixed by two dependent changes:
  - always passing the already-compiled LogTemplate to the rewrite
    operations instead of a string constant.
  - reusing the compiled template object in clone()

Since LogTemplate is reused, and the first one contains a proper reference
to the appropriate configuration object, the NULL deref issue was
solved too.

Reported-By: Johnson, Chris <chris.johnson3@hp.com>
Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
logrewrite: Fix the template reference counting

In case of the subst() and set() rewrite statements, when the
implementation was changed to pass a template to the constructor
instead of a string, the free() remained in the parser. While that was
supposed to free a string allocated by the parser, after the change,
that free'd the template that we had stored in the rewrite struct
itself.

To correct the issue, both the subst() and set() constructors will ref
the template, and the parser-side will unref it, instead of free()ing
it up.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
Preparations for 3.4.1.

NEWS & VERSION updated for 3.4.1.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
Initial version of syslog-ng Lua configuration support

Syslog-ng now can use Lua as it's configuration language.
Only Log, Source, Destination elements are usable, and
a few module items. Lua support is (yet) unconfigurable,
it's on by default. You can change between the two types of config via a
command line option.
Fixed non-lua plugin loading, and added initial Filter support
Added typing of Lua config elements, and added source and reader options parsing.
Added initial global option parsing.
Added a bunch of global options.

Global options are almost done, only the harder ones are left out.
(Which deserves their own function). After completion, LuaOptionParser will be separated
to another file.
Added remaining global options.

Global options now are covered in lua configuration.
Minor reindent
Added first super-simple lua config testcase
luaconfig: Added proto options and msg format options to source options parsing
Fixed error messages and minor reindent
luaconfig: Separated options parsing into modules.