More efficient hazard curve update transactions.

Split the transaction to update hazard curves into smaller transactions, to
avoid unnecessary blocking of other workers that want to update the same
records.

See https://bugs.launchpad.net/openquake/+bug/1121825 for more (lots more) details. There is a marked improvement in efficiency with this change.