Fix #9103, implementing `cd -` in REPL shell mode

It needs to be changed to `tmpdir = escape_string(mktempdir())` due to no escaption takes place when you write to `stdin_write`. This effects windows path due to it uses backslashes, but it also effects linux if there is spaces in the path.