readdir: default to "." or pwd() depending on join keyword (#33175)
This is a pretty niche issue but it allows `readdir()` to work after the current
working direcotory has been deleted, whereas when `join=true` you need a path
which no longer exists, so `pwd()` fails and so `readdir(join=true)` also fails.