put a try/catch around `readdir` in REPL shell completion. helps #7576