pkg: Fix Coverity warnings
- Fix allocation size in config_get_repositories().
- Fix a memory leak in read_conf_file().
- Avoid a null pointer dereference in an error path in verify_pubsignature().
Fixes: e3b4a51580fc ("pkg(7): expand VERSION_MAJOR, VERSION_MINOR, RELEASE and OSNAME")
Fixes: dc4581589a32 ("pkg: clean support for repositories")
(cherry picked from commit c1557708f1fae1bb9c8e23e3bbb2aa2b055e1211)