Torch: add option to only write to flash device once

Change-Id: I41347bc28d625d9497b02ecc94c1e9252d94e4b2