Added ret. val. checking, db export per-source file generation (#7155)

In export_database.download_source_data(), added check for the return
value of store_result_into_file(), so that, if it has failed, the
file does not get uploaded to the CDN.