add handle for shutting down threads on module gc