core: Fail with a better error message when list_dir gets an empty path

(Yes, this did happen in real life...)
testsuite: Add a test for listing the root directory...

...and don't treat Path("/") like Path("").
auto merge of #6687 : catamorphism/rust/list_dir_empty, r=catamorphism

r? @brson (Yes, this did happen in real life...)