Fix adb flakiness on reboot

bug: 31950237

There are two lists of active ADB transports (devices),
and with the emulator, they can go out of sync.

This CL more conservatively checks if there are no
transports in either list before commiting to
register a new transport for the emulator.

(cherry picked from commit edaedfd5da41b2f5aa14b4d52742a6d8caa49214)

Change-Id: Id1201dc59c70825881dad80925c2e5bcc13dbd5e
diff --git a/adb/adb.h b/adb/adb.h
index 2797f6b..df59aaa 100644
--- a/adb/adb.h
+++ b/adb/adb.h
@@ -139,8 +139,10 @@
 int  init_socket_transport(atransport *t, int s, int port, int local);
 void init_usb_transport(atransport *t, usb_handle *usb, ConnectionState state);
 
+std::string getEmulatorSerialString(int console_port);
 #if ADB_HOST
 atransport* find_emulator_transport_by_adb_port(int adb_port);
+atransport* find_emulator_transport_by_console_port(int console_port);
 #endif
 
 int service_to_fd(const char* name, const atransport* transport);