Note: After adding the missing locking of m_devices_mutex, I had to move the locking of m_hooks_mutex to avoid a random deadlock between the CPU thread and USB scanning thread. (Either that or I would have to lock m_devices_mutex before m_hooks_mutex.)