Fix os_version() to work with Ruby 1.8

Change-Id: I7d221807a55773a00256546de9e993628e358132