REPL: spawn to avoid blocking typing, fix pkg repl transition sequencing (#54785)
Based on https://github.com/JuliaLang/julia/pull/54760#discussion_r1635765035
This changes the `prompt!` design to not consume on the two tasks until
inside the lock and spawns the two tasks to avoid blocking typing