Check that the hazard calculation mode is consistent with risk calculation mode

This avoids a common problem when the user provide a wrong hazard calculation ID.
The tests are running here: https://ci.openquake.org/job/zdevel_oq-engine/805/