Restore the -fdpair option implementation that was lost in the previous integrate.

This is necessary to fix the dexpreopt pass of -user builds. Note that this
should only fix ARMv5TE builds, since we still have other (different) issues
with ARMv7 emulation at the moment.
diff --git a/qemu-char-android.c b/qemu-char-android.c
index b351d70..05f80e7 100644
--- a/qemu-char-android.c
+++ b/qemu-char-android.c
@@ -662,6 +662,26 @@
     return qemu_chr_open_fd(fd_in, fd_out);
 }
 
+static CharDriverState *qemu_chr_open_fdpair(const char *fd_pair)
+{
+    int fd_in, fd_out;
+    char *endptr;
+
+    /* fd_pair should contain two decimal fd values, separated by
+     * a colon. */
+    endptr = NULL;
+    fd_in = strtol(fd_pair, &endptr, 10);
+    if (endptr == NULL || endptr == fd_pair || *endptr != ':')
+        return NULL;
+    endptr++;   // skip colon
+    fd_pair = endptr;
+    endptr = NULL;
+    fd_out = strtol(fd_pair, &endptr, 10);
+    if (endptr == NULL || endptr == fd_pair || *endptr != '\0')
+        return NULL;
+
+    return qemu_chr_open_fd(fd_in, fd_out);
+}
 
 /* for STDIO, we handle the case where several clients use it
    (nographic mode) */
@@ -2160,6 +2180,8 @@
         chr = qemu_chr_open_file_out(p);
     } else if (strstart(filename, "pipe:", &p)) {
         chr = qemu_chr_open_pipe(p);
+    } else if (strstart(filename, "fdpair:", &p)) {
+        chr = qemu_chr_open_fdpair(p);
     } else if (!strcmp(filename, "pty")) {
         chr = qemu_chr_open_pty();
     } else if (!strcmp(filename, "stdio")) {