Added code to shutdown device if the device is already in booted state while erasing content and settings