Fix linux distribution detection

Among other things, this commit fixes detection of RHEL 7 Beta/RC.