Check free space before downloading a file

This checks for free space on the tmp and cache filesystems before downloading a file.

It also refactors the code in `console.py` that displays a filesize in a human-friendly way so it can be reused in the error message for this feature.