This fixes a build error occurring when building a configuration
having fontconfig enabled and `home.packages` only containing one
package installing things to `/lib`.
Also adds a number of test cases to verify the fontconfig cache
generation functionality.
Fixes#703