Revise insured losses algorithm

Companion of https://github.com/gem/oq-risklib/pull/61

Requires https://github.com/gem/oq-engine/pull/1264