Problem:
Crash on startup in some situations due to call to `set_curbuf`
with the current value of `cur_buf`.
Solution:
Switch buffers before doing the wipeout of the stdin buffer.
Use cmdline cmds instead of raw buffer pointers to avoid lifetime issues.