fix for undefined string escaping

It seems like sometimes (I saw it on the fail event), the err argument is undefined causing you to try to escape an undefined string in the teamcity runner. I know this is a rather naive fix, but might be a valid safety check..