Quote variable in existence test

Thanks to a shell glob (which should die), $dir can contain more
than one path, which yields a syntax error unless $dir is quoted.