smurf: change smf_calc_wvm to use per-thread cache

smf_calc_wvm is called as part of the metadata fix-up process when a file
is opened. This happens many times, including when downsampling. In the
case of smf_downsample, each file is opened with a worker thread. Before
this partch, smf_calc_wvm used a single cache which was usually created
in the main thread. This caused an error when opening files within
smf_downsample, as the cache was not locked by the current thread. This
error was subsequently annulled and so the fact that the cache was not
being used went unnoticed, except for a dramatic slow-down in makemap.

To avoid all these sorts of problems, I've changed smf_calc_wvm so that
each thread uses its own thread-specific cache.