Avoid returning duplicated data in the classical calculator

The duplicated curves (i.e. curves generated by the same rupture and the same GSIM, therefore identical) are the cause for the large inefficiencies in use cases with complex GMPE logic trees.
The solution is to group the realizations with the same GSIM together, perform the computation once and return the result once.
Tests are running here:  https://ci.openquake.org/job/zdevel_oq-engine/381

See also https://bugs.launchpad.net/oq-engine/+bug/1300796