Better task spawning

Now the tasks are spawned while the sources are being filtered: https://bugs.launchpad.net/oq-engine/+bug/1309457. The tests are green: https://ci.openquake.org/job/zdevel_oq-engine/433

Notice that a companion pull request https://github.com/gem/oq-commonlib/pull/10 is needed.