Arduino Due gets crazy if unplugged while sending

Adding Serial.begin(115200) before the SerialUSB.begin(115200) has no efect in the behaviour of my board. Without adding that, the board is powered with the other USB, the count doesn´t stop when plugged again the native USB.
I will try to upload the same sketch changing the Due library version. I don´t know what kind of test could be made to understand what´s wrong.