app: aboot: Optimize watch dog function

Initialise the watch dog driver at the early of LK
so that early kernel stalls / crashes can be caught.

Add a thread to feed dog and use a common function to
write dload cookie.

Change-Id: I2299405ba605b883031c0f5d6f00f5de934d351a
diff --git a/app/aboot/aboot.c b/app/aboot/aboot.c
index 2f8a853..1e134ba 100644
--- a/app/aboot/aboot.c
+++ b/app/aboot/aboot.c
@@ -773,10 +773,6 @@
 
 	enter_critical_section();
 
-	/* Initialise wdog to catch early kernel crashes */
-#if WDOG_SUPPORT
-	msm_wdog_init();
-#endif
 	/* do any platform specific cleanup before kernel entry */
 	platform_uninit();
 
@@ -3567,6 +3563,11 @@
 {
 	unsigned reboot_mode = 0;
 
+	/* Initialise wdog to catch early lk crashes */
+#if WDOG_SUPPORT
+	msm_wdog_init();
+#endif
+
 	/* Setup page size information for nv storage */
 	if (target_is_emmc_boot())
 	{