Fix incorrect pointer cast in lock purging code.

NextDB() takes a (void **) pointer, not a (void *), so we would write
the pointer value into the struct instead, giving incorrect results
when comparing the time later.
Introduce timed tests in acceptance test framework.

They enable waiting for a period of time, for example to let locks
expire, while running other, non-timed tests in the meantime. See the
README for more details.
Redmine #6088: Fix cfengine template producing a zero sized file.

The bug depends on timing: If you run a file promise with a template,
everything works fine. Now, if you run the same promise again after
more than one minute, but less than three, the resulting file is
empty.

The reason is that the internal bundle produced by the cfengine
template engine has an ifelapsed value of 3 minutes. What would happen
then is that the file promise, which has an ifelapsed value of 1,
would execute, but none of the contained edit_line promises would,
leaving the file empty.

Fixed by reducing the ifelapsed value for internal edit_line promises
to one.

Also moved the definition to a more local header file. It is not
needed globally.
Merge pull request #1759 from kacfengine/timed_tests

Timed tests and fix for zero-sized file.