Slimmed down the amount of code with the lock.

DirectoryScanningMonitor.AddDirectory(...) had a lot of code within a lock on the internal folders field. This should reduce the amount of time spent with folders locked.