Fast scenario export

The export time of the GMFs depends very much on how much packed are the arrays in the table gmf_data (long arrays are best).
For the scenario calculator we can safely assume that the generated GMFs fit in memory and that the amount of data is small enough not to kill celery/rabbitmq (both assumptions are not safe for the event based calculator). Given such assumptions, we can return the GMFs to the controller node and we can regroup them so that they are stored in an optimal way in the database. For instance in the case of demos/risk/ScenarioRisk there are 1000 realizations and we can store arrays of 1000 elements instead of arrays of 1 element each. With this trick the runtime of the demo (which is totally dominated by the export) goes down from 46 minutes to 4 minutes.

The tests are green: https://ci.openquake.org/job/zdevel_oq-engine/838