Add memoization to match.c

This is a first-cut attempt at crude memoization for match.c, which
enables Command-T to better hand "pathological" inputs like:

  needle   : "aaaaaaaaaaaaaaaaa"
  haystack : "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"

With memoization, we're much closer to our desired theoretical
worst-case quadratic runtime for this kind of input.

In order to make this fast, we're using a stack-allocated dynamic array
(possible in C99). The size is suitably small (needle length times
haystack length).

We want to remember the score for any given needle index/haystack index
pair, so we just use an array of doubles -- ideally I would have used a
proper multidimensional array, but I am not sure it's possible to do
that with dynamic stack-based allocation in a way that allows me to
declare a useful pointer to it in a struct -- and index into it on
needle index * length + haystack index. This could likely use some
commenting to make clearer what is going on.

We initialize the array with DBL_MAX to distinguish between
previously-calculated scores of "0.0" and merely missing scores.

I added some boundary checking to make it easier to reason about the
state of the recursive call (ie. by not even making it in the case where
we have zero-length needle or haystack).

Consider this a work-in-progress for now. I am going to follow up with
some benchmarks so that I can test this against what was there before
for both "pathological" and "non-pathological" workloads.

Related:

  https://wincent.com/issues/2094

Signed-off-by: Wincent Colaiuta <win@wincent.com>