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
You are right, I just saw the number without seeing that it was used to initialize max_cache_size.