Fix build issues and add a new config parameter 'userAgent' to proxy

Maybe this is helpful for others, too.

I've added a fix for download issues on Linux. For me, dl.renameTo() failed since dl and dest are on different filesystems (/tmp vs /home).

Maybe it is better to split the pull request into parts?