[Ide] Fix crash when running custom tools

Fixes bug #21460 - Xamarin Studio hangs with beach ball when building a project