fix(lua): cure sorting woes
fix(lua): cure sorting woes

The problem here was that, with my refactorings, I stopped sorting an
array of `haystack_t` structs and instead starting sorting an array of
pointers to `haystack_t` structs.

In the meantime, the heap continued to manage a set of pointers to
structs.

So, the comparison function being called by qsort needed to be updated
to dereference the pointer (ie. it was being called with a pointer to a
pointer, so to get the actual struct, I needed to dereference it).

In the meantime, the _same_ comparison function was being called by the
heap, but not expecting/needing the dereference.

The fix then, is to make a wrapping comparison function and give it too
the heap. The heap then calls the comparison function that qsort uses.

It's possible that for performance, I may want to invert this wrapping
relationship. We do _lots_ of heap comparisons while scoring candidates,
but we only do a bit of sorting at the end.

wincent/command-t,wincent/command-t,wincent/command-t