speed up AsyncResult._wait_for_outputs (don't waste 0.01 seconds)

Greatly reduces waiting time on ready() call for large calculations.
Merge pull request #3308 from akhmerov/master

Speed up AsyncResult._wait_for_outputs(0)

Greatly reduces waiting time on ready() call for large calculations.