Fix bug #3009 ‘"Rebuild folder tree" causes SIGSEGV if a directory name isn't valid...