Fix for locking issues in redmine/6334

I don't understand what is being tested here.  The test is called ifelapsed-0; I do indeed see an ifelapsed in it; but I don't see what this has to do with the abort class stuff you've been doing above; and I don't see what is being tested by your use of ifelapsed.  A comment at the top of the file explaining the test would be helpful.