Fixed terminate issue in UIMLApplicationTerminateApps