Support PREF_DIR change for Metalink files

Reworked previous commit adeead6f0396e2f8551d1182972e277728fd6c8b, and
now support changing PREF_DIR for Metalink downloads.