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