Solved the problem with UHS

See https://bugs.launchpad.net/oq-engine/+bug/1362649. I also did some cleanup on the hazard map generation mechanism to be consistent with the rest of the code. The tests are green: https://ci.openquake.org/job/zdevel_oq-engine/635
I would prefer to keep it, because if you remove it, it seems that there is not the possibility to compute quantiles even if one changes the logic tree. And now that there is a meaningful error message, this should not cause any problem.