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

I added ClassicCommands.killall("iOS Simulator") because the iOS Simulator Window was still open even after I ran 'xcrun simctl shutdown' command. But I was able to Reset the content and settings" after the shutdown command. I will remove the call to ClassicCommands.killall("iOS Simulator") and send the request.