[PTFM-11710] Replace stdio wrappers with originals for raw_input

On Python 2, raw_input ceases to properly flush output and bind readline when sys.stdin and sys.stdout are replaced. The easiest solution turns out to be to set them back to what they were and do the encoding and decoding manually.

This is presumably not threadsafe, but for now we don't ever want to prompt the user for CLI input and simultaneously be doing something else.