Fixed a bug when FLASHing without ROM locked

Change-Id: Idcc3ab160e95bacd7050f20e2bc4b12eb6cdac6b