Upload of sketch with avrdude stuck only outside of IDE
@per1234 was correct:


  Note that the auto-reset is initiated when the computer opens the serial port at 1200 baud and then closes it


From Arduino.cc

In practise, this means that avrdude first has to be executed like so:

$ avrdude -patmega32u4 -cavr109 -PCOM6 -b1200


Where COM6 is the same serial port the arduino is being displayed on in the Arduino IDE. The exit code of this will not be 0 and display a lot of error messages (even with -q -q), but it does exactly what it should.

After a short delay (in a makefile, use sleep 1), the Arduino will reconnect, ready to be programmed. That's when the actual programming command has to be issued:

$ avrdude -v -patmega32u4 -cavr109 -PCOM10 -b57600 -D -Uflash:w:mysketch.ino.hex:i


Notice that the serial port is now a different one! That's why the Arduino IDE actively searches for a new Arduino instead of using the same serial port set in the "Tools" menu, as I pointed out in my question.