Fix sed in `DISTRO_MINOR_VERSION`.

Additionally, if `PREFIXED_DISTRO_MAJOR_VERSION` or `PREFIXED_DISTRO_MINOR_VERSION` equals `_`, it's value is reset to an empty string.