fix adb sideload

- "Cancel" button handling requires another thread
- simplify handling of child pid
- merge duplicated code for reinjecting TWRP after installation
- fix error that showed on host PC after sideload finished
- fix problem where adbd sometimes does not stop correctly

Change-Id: I536877f024b606756c6a3289c6ddfdba423a60d6
diff --git a/adb_install.h b/adb_install.h
index 604c61d..24e9e21 100644
--- a/adb_install.h
+++ b/adb_install.h
@@ -21,6 +21,6 @@
 
 void set_usb_driver(bool enabled);
 void maybe_restart_adbd();
-int apply_from_adb(const char* install_file);
+int apply_from_adb(const char* install_file, pid_t* child_pid);
 
 #endif