Move otadexopt-related logic to otapreopt_chroot binary

This allows us to only mount APEXes once during postinstall, instead of
mounting them for each APK being optimized.

Ultimately this CL just moves the while loop from otapreopt_script.sh
into otapreopt_chroot binary, and makes otapreopt_chroot communicate
with otadexopt service via binder.

Without this patch a no-op OTA takes 669.617 seconds
With this patch: 361.991 seconds

Bug: 190817237
Test: manual OTA
Change-Id: I02e80a8e68b6d274a007599371e43cd15330d351
diff --git a/cmds/installd/otapreopt_script.sh b/cmds/installd/otapreopt_script.sh
index f950276..8bcbc9f 100644
--- a/cmds/installd/otapreopt_script.sh
+++ b/cmds/installd/otapreopt_script.sh
@@ -58,23 +58,7 @@
 PROGRESS=$(cmd otadexopt progress)
 print -u${STATUS_FD} "global_progress $PROGRESS"
 
-i=0
-while ((i<MAXIMUM_PACKAGES)) ; do
-  DEXOPT_PARAMS=$(cmd otadexopt next)
-
-  /system/bin/otapreopt_chroot $STATUS_FD $TARGET_SLOT_SUFFIX $DEXOPT_PARAMS >&- 2>&-
-
-  PROGRESS=$(cmd otadexopt progress)
-  print -u${STATUS_FD} "global_progress $PROGRESS"
-
-  DONE=$(cmd otadexopt done)
-  if [ "$DONE" = "OTA incomplete." ] ; then
-    sleep 1
-    i=$((i+1))
-    continue
-  fi
-  break
-done
+/system/bin/otapreopt_chroot $STATUS_FD $TARGET_SLOT_SUFFIX $DEXOPT_PARAMS >&- 2>&-
 
 DONE=$(cmd otadexopt done)
 if [ "$DONE" = "OTA incomplete." ] ; then