TS-2553 Fix a crash in the Metalink plugin

I think the existing CHANGES entry for this issue still covers it.
Please feel free to squash any of the changes to clean them up, and let me know if I can improve the style.
Thanks!