backends: Destroy dbi/unixsock clients on shutdown.

This would also be cleaned up when destroying the registered user data objects
but doing so on shutdown in much cleaner.
parser: Don't leak memory when building nested matchers.
store_lookup_test: Dereference objects returned from the store.