Replace calls to external uname with os.uname()

Use the os.uname() library function which calls uname(2) directly.