Simplify the inner NUL check
Pass the string pointer to the destructor closure

This optimizes the most common case where the closure does not
need to capture any other data, and as such may be a simple function,
potentially saving the box allocation.