Increase a little bit the coverage and fix PIPE usage.

The shell have a PIPE limitation, fix using a temporary file instead of the subprocess.PIPE.