Handle multiple redirects for gist_tag

GitHub Gist now redirects a few times to get to the eventual raw code. This handles it recursively rather than expecting 2 redirects, and is an alternative to #1503.

[fixes #1502]