Fixed deadlock involving delayed scheduler and Directory.

This change reduces the coverage of both locks.