Fix crash when unplugging usb/charger; disable log in sleep