Prevent prepare_for_firmware_update() called more than once

This addresses the fix for this issue : https://community.spark.io/t/solved-cloud-flashing-hardly-works-when-this-program-is-loaded