Fix task failure handling so that task failures from included builds are not lost. Previously, a task exception would be ignored if no task in the main build directly depended on the failed task and was still scheduled to run at the point in time where the task failed. In some cases this resulted in the build being reported as successful when in fact some task in an included build had failed. This change means that some exceptions will be reported twice, but this is better than not at all. A subsequent change will fix this.
This change also decouples waiting for completion of tasks in an included build from firing the build finished events and other cleanup. Now all tasks in all builds are completed before finishing up any builds.