dcache: Fix locking bugs in backported "deal with deadlock in d_walk()"