Fixed convergence detection and added a test case.

The problem was that signalStep and collectStep on WorkerApi were not
blocking.