Update arduino.mk to fix chipKIT flashing.
Use less dynamic memory allocation and catch when we go OOM.