Fix filetransfer download to follow URL redirection

This allows libcurl to follow a URL when downloading a file.

Fixes #586