Add: Acceptance test for ifelapsed

Ifelapsed should always be respected, especially at the individual
promise level.

Ref: https://dev.cfengine.com/issues/6334
Adjust test so that it fails for the right reasons.

Test passes if second cf-agent invokation also uses -K, which
is expected (and a crude workaround). But at least it shows that
the test is implemented correctly now.

Using ifelapsed => 0 in the method promise in bundle example
is necessary.

The regex can probably be made less aggressive, but it does the job.
Implement the currently held locks as a stack.

The atexit handler can then clean up the entire stack of
currently held locks, rather than only the one that was
acquired last.

If any promise sets an abort class, the exit handler is
called, cleaning up the stack. Promises in the next run
are then no longer blocked, and usual lock elapse kicks in.

Fixes Redmine #6334
Merge pull request #1961 from vohi/redmine/6334

Fix for locking issues in redmine/6334