Use a temporary file instead of relying on system pipe buffer size

This is in reference to issue #220.