(PUP-2631) Elide long URIs for 404 message

When the agent encounters a 404 response from the master and it has been
told to fail on 404, it previously output the entire path plus query
string that it requested. However, the most common case where this
occurs is when requesting a catalog, which can have a very long query
string if the request was done with a GET. This does not always occur
because even longer query strings will result in the agent using a POST
instead of a GET, which causes the long query string output problem to
go away.

In order to fix this the query string is now elided to 100 characters
(97 characters of the original text plus 3 periods).  In order to still
be able to debug any problems that might result from the query, however,
the query string is *not* elided if the log level is `debug`.
(PUP-1044) Make FileBucket::File use a local file whenever possible
(PUP-1044) Add info output for when file/string is used for checksum

This commit adds Puppet.info calls to make it possible to monitor the
number of file vs string checksum computations  They can be ovserved
when running in verbose mode.
(PUP-1044) Cleanup commented out code, and comments
(PUP-1044) Fix missing file mode in call to file system open

The mode 'nil' was accidentally dropped in the call to open the
file to get a stream. This caused 9 tests to fail.
(PUP-1044) Replace IO::copy_stream with FileUtils.copy_stream for 1.8.7

Ruby 1.8.7 does not have IO::copy_stream, this method is only available
on FileUtils.
Merge pull request #2971 from zaphod42/issue/master/pup-2631-non-existant-env-produces-long-message

(PUP-2631) Elide long URIs for 404 message
Merge pull request #2982 from hlindberg/PUP-1044_filebucket-less-memory

(PUP-1044) Make FileBucket::File use a file when possible