Fix handling of accepted locales
Fix handling of accepted locales

The code that sorts the Accept-Language header by quality leaked
languages under certain circumstances and was overly complex.
Replace it by a simpler implementation that sorts the returned
list instead of trying to sort the string array in place.

GNOME/gupnp,GNOME/gupnp,GNOME/gupnp,GNOME/gupnp