riemann: Refactored worker_init, extracted methods for adding fields to event.
riemann: Skip empty fields

When adding properties to an event, skip empty fields before trying to
do any type casting. This allows metric(int("${foo:-}")
state("${state}")) to work correctly, and skip the metric field if it is
empty, and therefore fixes #258.

Reported-by: Fabien Wernli
Signed-off-by: Viktor Tusa <tusavik@gmail.com>
Merge pull request #278 from talien/f/riemann-skip-empty-fields

riemann: Skip empty fields
main: do not intialize control socket when only syntax-check is required

When syslog-ng is started for checking a config file,
control socket is "stolen" by the syntax-checker syslog-ng
from a previously started syslog-ng.

References: #276

Signed-off-by: Budai Laszlo <Laszlo.Budai@balabit.com>