Detach peripherals on Shutdown/Reboot