retry OTA flash up to 5 times if it fails or if ECONNRESET is detected