Assure proper termination using context session
Current main loop quits when closing window callback is called.
Btw, it does not assure proper termination of changing watch face
because context session stops too early and callback can not be called
and then dead lock happens.
So, this CL extends the main loop until all the context sessions are finished
and covers following termination scenarios.
* h/w back key
* exit pop up menu
* exit command |pkgcmd -k|
* uninstall command |pkgcmd -u| while webapp runs
* changing watch face
Bug: http://suprem.sec.samsung.net/jira/browse/TWF-2765
Change-Id: I1767ef5f14e393ffc59668b0b9925d781abfd2f5
Signed-off-by: Youngsoo Choi <kenshin.choi@samsung.com>