Misc fixes/improvements to apk downloading

This started as a fix to #625 (closed), but quickly turned into a mini rampage to fix and/or improve a few different things in the DownloaderService. Hopefully the commits are self explanatory as to what they fix, but of course feel free to ask questions if you have any.