mime: fix mimetype alias resolution

This is needed for compatibility with shared-mime-info >= 1.1. This
is because the gzip mimetype is:

    application/x-gzip for shared-mime-info <= 1.0
    application/gzip   for shared-mime-info >= 1.1

For shared-mime-info >= 1.1, application/x-gzip is an alias of
application/gzip.

This is needed for support on Ubuntu precise and later that use the
later shared-mime-info (Debian is still on 1.0).
Merge branch 'master' into debian