cmsis_dap: Wait CMSIS-DAP MSD remount cycle to confirm successful programming
After CMSIS-DAP MSD finished programming firmware (either successfully or not), it "unmounts" and "remounts" the USB MSD device (actually, issues MSD "media changed" notifications). We now wait for "unmount" and following "remount", and check for failure file, FAIL.TXT. If it's present, we dump it and properly fail the operation (which for example allows parent LAVA boot-retry action to try it again).
Note the detection of MSD unmount/remount requires issues FS sync commands (which we now do on Python level using os.sync(), instead of calling external "sync" command). (Commenting os.sync() calls is a way to trigger failure behavior on hardware which is susceptible to it.)
Finally, while this new behavior is made default, a "skip_autoremount_wait" option is added to revert to the old behavior (of just calling sync once and waiting static delay). It can be set in a device dict for boards which may turn out to have issues with new process.
Signed-off-by: Paul Sokolovsky email@example.com