Improved the way we wait for the build to finish.

This is more reliable now.
Wait also for builds to finish before trying to close solution on integration test cleanups.
Fixed failing tests, improved test content isolation.