Interesting... could it be something related to power saving settings ? Perhaps the OS doesn't see "activity" (i.e. data) on a usb port it assumes nothing is connected to it, so it shuts it down to save battery.
If I'm right, putting a Serial.println() in loop would "fix" the issue.