improved distro detection mechanism in os_check function