Modify bagofrequest#download_file to write file in chunks to handle large sized file memory consumption.