jsonparser: Throw an error when the JSON input is not an object

syslog-ng assumes that the JSON input the parser receives will be an
object, if it is not, we should throw an error. The most likely case is
a miss-parse, we should not try to be clever there, but fail instead
with a sensible message.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
json-parser: When parsing fails, tag the error with the input

When JSON parsing fails with returning a NULL object, add the original
input to the emitted error message, for easier debugging.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
afprog: Fix the grammar so that program() source works again

The grammar of the afprog module was a bit flaky, which resulted in
program() sources not being recognised, because the grammar couldn't
properly terminate the sentence, and skipped it instead. By refactoring
the grammar into the same style the program() destination uses, the
problem went away. This closes #34.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
misc: fixed truncated IP addresses set in $HOST

In case getnameinfo() fails to resolve an address, it automatically returns
the numeric IP address without setting an error condition, which messes up
the logic in resolve_sockaddr() and causes the IP address to be truncated if
use_fqdn() is set to no.  This patch instructs getnameinfo() to return
failure instead by passing NI_NAMEREQD in flags.

References: bugzilla #240
Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>