make PIPE_DIR overridable

This is useful in environment where temporary files should be in a different location.