download_strategy: add a timeout option

To switch from a main url to mirror sites explicitly, a timeout option is required.

This patch set is originated by #21606. 
I can't find a way to keep track in #21606. If I make a disturbance in pull request, please correct me.