[REPL] fix computation of startpos for path completions (#52009)
Fixes https://github.com/JuliaLang/julia/issues/51985
Ensure that the REPL completions escape and unescape text correctly,
using the correct functions, and accounting for exactly what the user
has currently typed.
The old broken method is left around for Pkg, since it has an
over-reliance on it returning incorrect answers. Once Pkg is fixed, we
can delete that code.
Co-authored-by: Jameson Nash <vtjnash@gmail.com>