Fix emulator core and UI on Windows

There are two parts in this CL:
1. Fixing the Windows build (missing set_fd_handler)
2. Replacing read/write with socket_recv/socket_send.

Change-Id: I5fa599774260257d481b738a892e1124135fc319
diff --git a/android/sync-utils.c b/android/sync-utils.c
index 6d3cea6..617ba8b 100644
--- a/android/sync-utils.c
+++ b/android/sync-utils.c
@@ -74,6 +74,7 @@
             connect_status = iolooper_wait(looper, timeout);
             if (connect_status > 0) {
                 iolooper_del_write(looper, fd);
+                break;
             } else {
                 iolooper_free(looper);
                 return NULL;
@@ -184,7 +185,7 @@
             return -1;
         }
         do {
-            ret = read(ssocket->fd, buf, size);
+            ret = socket_recv(ssocket->fd, buf, size);
         } while( ret < 0 && errno == EINTR);
     } else if (ret == 0) {
         // Timed out
@@ -229,7 +230,7 @@
         }
 
         do {
-            ret = write(ssocket->fd, (const char*)buf + written, size - written);
+            ret = socket_send(ssocket->fd, (const char*)buf + written, size - written);
         } while( ret < 0 && errno == EINTR);
 
         if (ret > 0) {