Ensure threadpool is stopped when the plugin is stopped