When downloading a file, and we know it's size from the header, check that the temp filesystem and, if necessary, the cache filesystem have enough space before beginning the download.
Merge pull request #858 from mdboom/utils/check-file-size-before-download

Check free space before downloading a file