pkg(7): expand VERSION_MAJOR, VERSION_MINOR, RELEASE and OSNAME
Catchup with pkg(8) by expanding more variable when parsing repositories
The only missing variable now is ARCH, this will have to wait for
pkg 2.0 to be the lowest supported version.
(cherry picked from commit e3b4a51580fcd4a1ddf0d61feb5f325ff1de5420)