Fix the memory occupation issue for the scenario_risk calculator

See https://bugs.launchpad.net/openquake/+bug/1132018

The discussion of the problem is in https://bugs.launchpad.net/openquake/+bug/1132017