Fixes deadlocks when running in-process.