lib/package_configure.c: fix use-after-free reported by clang.
lib/repo.c: fix two memleaks in error paths found by clang.
Fixed some warnings reported by clang.