Fix problems with tracing on Windows - cut line at first ):, not :

This prevents catching the drive letter as the end of the line
Reduce IO by buffering reads and writes more efficiently