set_gbb_flags: Check write protection status before starting to flash.
set_gbb_flags: Check write protection status before starting to flash.

People trying to override GBB flags and not having write protection disabled may
corrupt whole RW section of firmware.

To avoid that, we should check write protection before starting to invoke
flashrom commands.

BUG=chromium:341242
TEST=./set_gbb_flags.sh 0x39 # Aborted on a write-protected system, as expected.
BRANCH=none

Change-Id: I6b2dcc75b87dc5ceace0d7caec62ded787b2b534
Signed-off-by: Hung-Te Lin <8a7fce4940baad93a69f5073b383c85deed9d9c4@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/185653
Reviewed-by: Randall Spangler <62698fdbb84d1779579ee80c3f39fac22017e5bc@chromium.org>
Commit-Queue: Hung-Te Lin <8a7fce4940baad93a69f5073b383c85deed9d9c4@google.com>

ccaapton/vboot_reference,coreboot/vboot,coreboot/vboot,ccaapton/vboot_reference,coreboot/vboot,ccaapton/vboot_reference,geekboxzone/mmallow_external_vboot_reference,coreboot/vboot,acorn-marvell/vboot_reference,ccaapton/vboot_reference,geekboxzone/mmallow_external_vboot_reference,acorn-marvell/vboot_reference,acorn-marvell/vboot_reference,geekboxzone/mmallow_external_vboot_reference,geekboxzone/mmallow_external_vboot_reference,coreboot/vboot,acorn-marvell/vboot_reference,geekboxzone/mmallow_external_vboot_reference