tools lib traceevent: Unregister handler when function plugin is unloaded