Fix: Made API shutdown more robust
Fix: Made API shutdown more robust

stevenvanrossem/son-emu,mpeuster/son-emu,stevenvanrossem/son-emu,stevenvanrossem/son-emu,mpeuster/son-emu,mpeuster/son-emu,mpeuster/son-emu,stevenvanrossem/son-emu