Allow avrdude to erase the chip before programming during ispload

We currently pass the -D (do not erase) option to avrdude
unconditionally in order to work around an Arduino Mega bootloader bug.
However, this has the side-effect of breaking the ispload target for all
non-XMEGA chips, since a write operation on these chips essentially ANDs
the new program with the existing memory contents. If the memory is not
first erased to contain only 0xff, the resulting image is garbage. This
patch makes it so we pass -D when we're using the Arduino bootloader but
don't pass it when we're using ISP directly.
Fix speed regression since 8d443f62c, faster than 1.3.4 now

Audited *some* use of := vs. =, when calling shell/foreach/wildcard,
could probably do with more looking into.
add library autodetection when compiling