CLEANUP: chunks: release trash also in deinit

Tim reported in issue #1676 that just like startup_logs, trash buffers
are not released on deinit since they're thread-local, but valgrind
notices it when quitting before creating threads like "-c -f ...". Let's
just subscribe the function to deinit in addition to threads' end.

The two "free(x);x=NULL;" in free_trash_buffers_per_thread() were
also simplified using ha_free().
1 file changed