fixed all thread deadlocks, tests pass now besides threads global destruction