Use os.uname() instead of calling uname in subprocess

Related-Bug: #1291535

Change-Id: I57e18c0b95904f318e3fff08cd18b32e28f48834
(cherry picked from commit 22a0692c2e9b0276c6b4dd2f66cedc70f7f835a5)
Merge "Use os.uname() instead of calling uname in subprocess" into stable/icehouse