dbparser: Validate the current time when ticking

The tick timer did not validate the current time, which could result in
timers being scheduled too far away from the current time.

Systems that have CLOCK_MONOTONIC shouldn't be affected because those do not
go backwards.

Signed-off-by: Juhasz Viktor <jviktor@balabit.hu>
Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
patterndb: handle time going backwards

When the system time is going backwards, we should try to realign patterndb
time keeping with the system time. To do that, we save the current system
time in last_tick, so an upcoming tick will actually have an effect.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>