Changed the generation of hazard_curves to use the gmf_agg table

The goal here is to speedup the post-processing phase, by reading the rows already aggregated in the gmf_agg table. See https://bugs.launchpad.net/oq-engine/+bug/1169703

From some experiments on my machine this change is likely to give a substantial speedup.