Fix race condition in auto-boot code
Fix race condition in usb scanning code