Revert "Simplify queue draining code"
Revert "Simplify queue draining code"

This reverts commit cc6f1c3846a77f42c3d5cab013dd012bab2a682a.

Note: The task must be kept on the queue until after it is called.
Otherwise drain() will be called recursively.

reactphp/promise