osc: Fixed deadlock during destruction.