lib/scripts: fire unloading event during reload