Add a beforeunload warning while flashing is in progress to prevent accidental tab close/refresh, which can interrupt and corrupt the process