Fixed the issue of slow sources

See https://bugs.launchpad.net/oq-engine/+bug/1271561 and the document
https://docs.google.com/a/openquake.org/document/d/1BpaEX3no3UJZD9N1g5RlcwRnwaO3AaxAUslO7gxL1b4/edit?usp=sharing for a detailed explanation.