fix thread termination logic

removes unused variable warning
add some more events
remove precompiled PluginAPI.dll