Added missing call to RemovePortFromList if doflash throws exception.