[Autotest][Py3] Update utils.py to support Python3

To support python3, utils.py must encode the computed hash,
and decode the data being read from the pipes. Without it TypeErrors occur
when trying to write to the buffers. This IS python2 compatible.
"""
autotest/files/autotest_lib/client/common_lib/utils.py", line 303, in process_output
    buf.write(data)
TypeError: string argument expected, got 'bytes'

"""

The changes have been tested in python2 and python3, along with the
utils_unittest

Ran 167 tests in 12.714s

OK
All passed!

BUG=chromium:990593
TEST=dummy_Pass (python2 and 3) utils_unittest

Change-Id: I6986005a43297d1584b8542ec0b1ce8e6861eb0c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/autotest/+/2547640
Tested-by: Derek Beckett <dbeckett@chromium.org>
Reviewed-by: Greg Edelston <gredelston@google.com>
Reviewed-by: Gregory Nisbet <gregorynisbet@google.com>
Commit-Queue: Derek Beckett <dbeckett@chromium.org>
diff --git a/client/common_lib/utils.py b/client/common_lib/utils.py
index bcd43ee..26a2695 100644
--- a/client/common_lib/utils.py
+++ b/client/common_lib/utils.py
@@ -293,13 +293,13 @@
             # read in all the data we can from pipe and then stop
             data = []
             while select.select([pipe], [], [], 0)[0]:
-                data.append(os.read(pipe.fileno(), 1024))
+                data.append(os.read(pipe.fileno(), 1024).decode())
                 if len(data[-1]) == 0:
                     break
             data = "".join(data)
         else:
             # perform a single read
-            data = os.read(pipe.fileno(), 1024)
+            data = os.read(pipe.fileno(), 1024).decode()
         buf.write(data)
         tee.write(data)
 
@@ -625,7 +625,7 @@
             computed_hash = sha.new()
 
     if input:
-        computed_hash.update(input)
+        computed_hash.update(input.encode())
 
     return computed_hash