GRADLE-2841 Ensured capturing output is thread safe

This resolves the issue with the flakiness of TestNGParallelSuiteIntegrationTest