Improve GHashTable key distribution

grid_tile_hash_func() turns out not to be very good.  Improve it, and
modify the cache hash_func() along similar lines.  Partial fix to
openslide_open() performance regression in hamamatsu.
hamamatsu: Verify consistent tile counts among JPEGs in a level
hamamatsu: Initialize JPEG levels in one pass
hamamatsu: Allocate jpeg_level inside initialization function
hamamatsu: Check tileno in compute_mcu_start() before using
hamamatsu: Use simple grid for JPEG

There's no fundamental reason we need to be using the tilemap grid.
Due to the large number of tiles in Hamamatsu, jpeg_tile allocation and
insertion were slowing openslide_open() down substantially.  On my system,
this change takes "openslide-quickhash1sum CMU-3*.vms" from ~800 ms to
~140 ms.
hamamatsu: Return FORMAT_NOT_SUPPORTED on fopen failure