Fix crash when ui-gadget unloads badge module