Support headless
Avoid hangs when reading pipes headless
Fix  #11118 s undefined in GrassUtils.py