(GH-265) Drain POSIX command runner IO pipes

This is based on GH-267