If you haven't tried it yet, I would switch to a different USB port, to one that is driven by a different USB host in your computer (or try a different computer).
If this doesn't help, you may try to remove the Arduino board from the rest of the UM2 electronics and flash the Arduino board only (on the UMO, this helps in certain cases).
Do you get a stable connection to the machine with e.g. printrun/pronterface?