[Core] FileService.IsDirectory should not crash for nonexistent directory

See also 70a9a711662a2aaddf8abf0672e492929e8455d0