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/gui/objects.hpp b/gui/objects.hpp
index 3f12ea7..bf07c86 100644
--- a/gui/objects.hpp
+++ b/gui/objects.hpp
@@ -283,9 +283,11 @@
 	int doAction(Action action);
 	void simulate_progress_bar(void);
 	int flash_zip(std::string filename, std::string pageName, int* wipe_cache);
+	void reinject_after_flash();
 	void operation_start(const string operation_name);
 	void operation_end(const int operation_status);
 	static void* command_thread(void *cookie);
+	static void* sideload_thread_fn(void *cookie);
 	time_t Start;
 
 	// map action name to function pointer