An attempt to solve the memory occupation issue for the event_based risk calculator

See https://bugs.launchpad.net/oq-engine/+bug/1169577

We need to run Miriam's computation with this branch on the cluster and see if the memory occupation problem is solved.