Fix intermittent failure to reset Leonardo boards before upload.

The original reset code only seemed to work on occasion, requiring a manual reset for the upload to proceed. This fix isn't pretty but seems to work every time. (For what it's worth I'm experiencing the same intermittent error in the Arduino IDE, so there's possibly some larger issue surrounding the Leonardo reset procedure.)