Provide function to handle downloads inside temporary directories, avoiding issues with partially completed downloads. Partial work towards chapmanb/bcbio-nextgen#127