fix locking on close (I forgot to remove the inner lock in one
of my previous fixes, so we deadlocked).