[autotest] Store afe_host in and remove host attributes to/from machine dict.

There are multiple times when the AFE is queried for random bits of info
(host attibutes, labels, etc).  To reduce the number of calls, store the
AFE host object into the machine dict so we can store it into the host class.
I chose the AbstractSSHHost class to grab it out of the arg dict since that
is used both by CrosHost and ADBHost.

Also removed host attributes as a class instance attribute since
afe_host contains all that info already.

Also use the os labels to do host class detection.

BUG=chromium:546741
TEST=Tested a couple scenarios:
- Manually on moblab to make sure cros/adb/testbed devices all pass
  dummy tests.
- Trybot job on gnawty-paladin.
- Moblab dummy suite run to ensure no breaking backward compatibility changes
  (moblab on R52 and testing with a tryjob gnawty build).
- test_{that,droid}.py on a cros/adbhost device.

Change-Id: I101c478c0f27f9fd444ccd4699a5c94e76d3b17e
Reviewed-on: https://chromium-review.googlesource.com/349990
Commit-Ready: Kevin Cheng <kevcheng@chromium.org>
Tested-by: Kevin Cheng <kevcheng@chromium.org>
Reviewed-by: Kevin Cheng <kevcheng@chromium.org>
diff --git a/server/hosts/adb_host.py b/server/hosts/adb_host.py
index 5e157df..857cf8f 100644
--- a/server/hosts/adb_host.py
+++ b/server/hosts/adb_host.py
@@ -218,11 +218,10 @@
 
         self.tmp_dirs = []
         self.labels = base_label.LabelRetriever(adb_label.ADB_LABELS)
-        # TODO (sbasi/kevcheng): Once the teststation host is committed,
-        # refactor the serial retrieval.
-        adb_serial = adb_serial or self.host_attributes.get('serials', None)
-        fastboot_serial = fastboot_serial or self.host_attributes.get(
-                'fastboot_serial', None)
+        adb_serial = adb_serial or self._afe_host.attributes.get('serials')
+        fastboot_serial = (fastboot_serial or
+                self._afe_host.attributes.get('fastboot_serial'))
+
         self.adb_serial = adb_serial
         if adb_serial:
             adb_prefix = any(adb_serial.startswith(p)