Updated retVal & finalRetVal control in doflash function when flushBuffer got an exception and avrdude failed.