Wait for app/sub tasks to finish