close stdin in popen3 in case the command hangs