Rewrite 'urlretrieve' helper to fix various download-related issues

- Py3: stop using legacy API of urllib.request and
       fix download of http(s) URLs containing user:passwd@
- Py2: avoid OOM when downloading huge files

Also build opener only once for performance reasons.
2 jobs for next in 0 seconds
Status Job ID Name Coverage
  External
passed BUILDOUT-NEXT

00:28:17

passed BUILDOUT-NEXT

00:07:37