Simplify memory handling
Not sure if this will be any better but teach the scanner "class" to take a pointer to a cleanup function and a void * pointer to be passed to it.
We would pass perhaps three different kinds of function to it. One would just free owned slabs passed in from elsewhere, the other would not free unowned slabs but instead call a deallocation function for the thing that does own them (eg. a watchman response instance, for example). The other (perhaps the same as the first) would free owned slabs the scanner itself had created.
The idea of all this is to make things more uniform and consistent, and perhaps allow us to get rid of the ghastly weak table[^weak].
[^weak]: See description of where it is used and description of big picture.
~Need to fix docs on scanner_new() too. It doesn't lead to scanner_free() freeing individual string contents.~