Fixes: Fix race-condition when threads are killed during shutdown