Avoid using grep and awk during OS detection

The target machine may not have these commands. `lsb_release` command may not be available, too, in which case we may be able to know the distro name by reading `/etc/lsb_release`.