Fix crash on USB disconnect