Fix deadlock caused by not leaving the critical section on all code
paths.

1 file changed