CHEF-4625: Explicitly close temp files to prevent sharing violations
Handle nil tempfile, ftp, http cases
Merge pull request #1062 from opscode/adamed-chef-4625

CHEF-4625: Explicitly close temp files to prevent sharing violations