Fix bug in SpreadAndWait

A recent refactoring of SpreadAndWait introduced a bug in the
next method.

Target: trunk
Request: 2.7
Require-notes: no
Require-book: no
Acked-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
Patch: http://rb.dcache.org/r/6056/
(cherry picked from commit abd425ec61580a827ed25ce8fbe9591d4bf724ec)
Merge pull request #203 from gbehrmann/fix/2.7/rb6056

Fix/2.7/rb6056