Fixed teamcity build detection in Rakefile for proper output formatting and test tracking in TeamCity CI builds