raw_input redirect bug fix for stdio gui, plus protect from input failures on systems without readline