Solved a long standing bug with inconsistent unpickling of the IMTs

This has been annoying me to no end on the engine side. See https://bugs.launchpad.net/oq-hazardlib/+bug/1322794
The tests are green: https://ci.openquake.org/job/zdevel_oq-hazardlib/82/