refactor get_uptime without popen() for OS X