fix an issue for when the root folder is deleted

Fixes https://github.com/dart-lang/spark/issues/1032

@gaurave