ml-batched-timer: fixed possible deadlock and cleaned up locking strategy

The aim of MlBatchedTimer is to batch timer updates in worker threads to
avoid having to make a round-trip between the worker thread and the main
thread. The point is to only make this round-trip when the target time
actually changes.

The locking strategy is deliberately racy at times so that we avoid
grabbing a lock in the fast path.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
lib/filter/tests/test_filters: fix builds in the uninstalled case

This patch adds -dlpreopen syslogformat to test_filters so that it can
find the syslogformat module while testing even if syslog-ng is not
installed.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
Makefile.am: Add PRELOAD_SYSLOGFORMAT and other helpers

Instead of hardcoding the same dlpreopen at many different locations,
add a helper variable to the top-level Makefile.am, and use that
variable in all other places.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
When doing make check in a subdir, use tests from subdirs too

Teach the Mk/subdir.mk snippet to recurse into subdirs of subdirs when
doing make check. This is a bit of a nasty hack, but gets the job done.

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