Safer file write for downloaded firmware.