It could be that the delay help to wait the usb link establishement.
In that case I would exepect the delay should be added before the usb_get_device_descriptor() function.
It could be that the enumeration is started 3 times in loop, and the delay added after the usb_get_device_descriptor() help for the next or last loop.