Core: Fix some deadlock regressions of yesterday's fix.
This is likely to cause some more of them though.