Fixed a race condition.

execution.isComplete() becomes true before all the listeners are invoked (which is necessary
because the nodes have to appear as heads before the listener can be called.)

When it happens, waitForCompletion() would return, causing the flyweight executor to quit,
making QueueTaskFuture to be marked as done. All this happen before finish() method gets
called and set the result.

In this change, I'm making waitForCompletion() actually wait until the finish() method runs.