Check and install device firmware updates

Change the boot target only after metadata, target/profile, image verification and OTA write are all successful.