test and fix for RT #52317: Calling run3 garbles STDIN