Fix order of xcodebuild events by waiting for subsections to be closed.
Fix order of xcodebuild events by waiting for subsections to be closed.

PSPDFKit-labs/xctool,PSPDFKit-labs/xctool,facebook/xctool,PSPDFKit-labs/xctool,facebook/xctool,adamjernst/xctool,adamjernst/xctool,facebook/xctool,facebook/xctool,PSPDFKit-labs/xctool,facebook/xctool,facebook/xctool,adamjernst/xctool,PSPDFKit-labs/xctool,adamjernst/xctool