Added 'unlock' option to flash write_image