[#2304] Fix executeReactor to wait for delayed to execute.

Problem
======

There was a bug in executeReactor which was not waiting for delayed calls to execute.


Why we got this
============

There was no test.


Changes
======

Fix code and add tests.
The code was stupid :)


How to test
==========

reviewers: @alibotean 

this is just to let you know about the changes

Thanks