Updated fix for #9128

Better use 'r+' while opening stdin as recommanded by s0undt3ch