Revise insured losses algorithm

Addresses https://bugs.launchpad.net/oq-risklib/+bug/1217438