util-app: Move copy_file() to Downlaoder

This function is no longer used by any module other than Downloader so
lets move it there as a private helper.

https://bugzilla.gnome.org/show_bug.cgi?id=738016
downloader: copy_file -> download_from_filesystem

Now that copy_file is a private method of Downloader, it makes sense to
change its name and signature to be consistent with its brother,
download_from_http().

https://bugzilla.gnome.org/show_bug.cgi?id=738016
downloader: Separate out fetching of cached file

Split out fetching of cached file code into a separate private method.

https://bugzilla.gnome.org/show_bug.cgi?id=738016
downloader: Explicitly close output stream

This is currently not required but in the following patches, we'll start
to first write to a temporary file and for that its important that all
output is written to the file, before it can be copied over to the
actual (cached) file.

https://bugzilla.gnome.org/show_bug.cgi?id=738016
downloader: Download to temporary location first

Instead of directly downloading to the cached path, download files first
to a temporary location. The filename has a '~' at the end so its
obvious that its a not regular file.

This fixes the issue of Boxes trying to use partially downloaded
files. Currently Boxes doesn't ensure that partially downloaded file is
deleted before exitting but even if it did, there will always been
crashes.

https://bugzilla.gnome.org/show_bug.cgi?id=738016