Fixing line breaks in the message caused by partial writes to stderr

For some reason file_put_contents to stderr added \n each time it was called on our system (php 5.3, linux). So teamcity was not able to parse the message. I didn't looked into it in more detail why it is appending \n, but writing the message in one go works fine and doesn't break anything for systems where it was already working.