Fix for upload problems on Arduino Leonardo (and derivatives) on OSX 10.9

Patch needs to be validated.
To be tested on Linux and Windows.