pakfire: Sync with upstream.

Imports a set of patches which fix various
bugs and errors.