BS-11317 : Fix unstable test LoopTest.executeAStandardLoopWithConditionUsingLoopCounter

- Replace the old waiting mechanism (request in database) by the new (event)
- Refactor tests