forked from dolphin-emu/dolphin
also make it more thread safe (avoid rare deadlock) and fix it trying to add devices before the CI has init
also make it more thread safe (avoid rare deadlock) and fix it trying to add devices before the CI has init